|
While I would echo what everyone has said, I would also like to point out you didn't give enough information, such as what OS your running, what your parameters are to GlobalAlloc, and how much actual memory you have in your machine.
But first, the obvious. If your allocating handles, make sure you realise that they are a FINITE resource per process. Second, if you allocate lots of VirtualAllocs, please understand they always start on a page boundry, and you have only 2GB of process space you can map it into (i.e. lots of little VirtualAllocs will eat into your address space pretty fast).
Same is true for threads. I can't tell you how many times I've ran into situations where someone says "I can only get just under 2000 threads". Did you check where ESP was pointing on thread entry? It's about a meg higher than the previous thread, isn't it? Decrease the thread stack size so the computer can map it in! Duh!
Anyway, need more info.
|