Reputation: 443
I am developing a "pyramid" game that uses a Minimax tree that searches for the "best" move .. but my game is freezing.
My deduction is that it's a memory problem but I am using only 124kb of memory. How much memory can I allocate with the new operator? Or, what is the memory limit assigned to my application by default.
Upvotes: 0
Views: 626
Reputation: 121881
You might also consider looking at possible stack overflow. Especially if your algorithm involves recursion.
Upvotes: 1
Reputation: 18451
It's probably not you are consuming all of memory, but you are consuming all of CPU! Check the logic of your game program.
Upvotes: 0
Reputation: 69802
The OS does decide how much memory you'll be able to allocate at each given time, making your question impossible to answer.
I would be you, I would show the faulty code instead of thinking it's the compiler or the environnement that does something wrong. 124kb is nothing on most platforms.
If it's not throwing a bad_alloc, I really doubt your new call will fail. It's certainly not the real problem.
Upvotes: 2
Reputation: 5982
I don't think a memory problem would cause your game to freeze before it would cause it to crash. You probably have an infinite loop somewhere. If you had a problem with the memory, I would imagine you would get an error message of some sort as opposed to the loop issue where it will just hang.
Upvotes: 0
Reputation: 92391
There is no limit by default.
If you allocate smallish objects, you can generally get 1 to 1.5 GB of them on 32-bit Windows.
Upvotes: 0