开发者

Available Memory Size in Visual Studio C++

I am developing a "pyr开发者_如何学Camid" 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.


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.


You might also consider looking at possible stack overflow. Especially if your algorithm involves recursion.


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.


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.


It's probably not you are consuming all of memory, but you are consuming all of CPU! Check the logic of your game program.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜