Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

CProgrammer

weirdest memory problem ever

This topic is 5367 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im going nuts here. I have an app that works great with small values as input but crashes with larger ones. When however I add a textbox command somewhere in the algorithm it always crashes no matter where I add the textbox. Its like the program is so unstable it cant handle the textbox. Geeze what kind of problem could this be. -CProgrammer

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Fruny
Array bounds overrun.


Is it possible that Array bounds have been overrun, the app doesnt crash but then crashes upon calling MessageBox?

-CProgrammer

Share this post


Link to post
Share on other sites
quote:
Original post by CProgrammer

Is it possible that Array bounds have been overrun, the app doesnt crash but then crashes upon calling MessageBox?

-CProgrammer



Yes, it is, because you may have trampled on some important memory related to it when you overran the array.

-Mezz

Share this post


Link to post
Share on other sites
quote:
Original post by CProgrammer
Oh and could such an effect be caused by using delete instead of delete[]


depends on whether you should be using delete[] instead of delete

Share this post


Link to post
Share on other sites
Hi! CProgrammer

I think I can help you.

You can''t allocate more memory than the stupid Windows XP Allocated Memory Limit.
So if the Total Allocated memory is 182504 kB and your Limit is 206108 kB you can''t alloate a memoryblock that is bigger than 206108-182504 = 23604 kb.
You can solve this like I did, set the minimum virtual memory limit to 4096 MB and maximum to 4096 MB. But the bad is that the game may not work on other computer.
Or you can try allocate many small memory blocks, that will increase the memory Limit, until you have allocated equal the amount memory you need. Then free it and allocate the big memoryblock. But I haven''t tried this.

I hope this helps you.

- DataWigge

Share this post


Link to post
Share on other sites
datawigge: Thanks, I think you just helped me majorly.
Actually my programm uses a lot of memory. Furthermore it crashes when a recursive function is executed for large numbers, so it calls itself more often and saves a larger single array. If what your saying is true I can search until I day and not find anything, phew. What solution is there. By the way I have 1GB ram but if windows limits than that doesnt matter. Is there a limit to the size of an array and can my app somehow tell windows that I need more memory.
Thanks for any advice on how to solve this.
-CProgrammer

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!