memory limit on gcc/g++/MingW

Started by
3 comments, last by Adam_42 14 years, 6 months ago
Hello, I'm allocating several memory blocks using _mm_malloc. When my application reach 360MB (approximatively) and I try to allocate one more block, _mm_malloc return NULL. Is there a compiler directive disabling memory limit ?
Advertisement
- how large are the blocks
- how often are they (de)allocated
- how many blocks are typically allocated
The blocks are around 50MB, every 2sec I create 3 of them.
They are created inside threads, they are 4 threads running at the same time. When my application reach 360-370MB and I try to allocate one more 16bytes aligned block, NULL is returned.
Did you try using another compiler and seeing if the same problem crops up?
Quote:Original post by rldivide
The blocks are around 50MB, every 2sec I create 3 of them.
They are created inside threads, they are 4 threads running at the same time. When my application reach 360-370MB and I try to allocate one more 16bytes aligned block, NULL is returned.


How are you measuring this 360MB?

The first limit I'd expect you to run into the the ~2GB address space limit. You'll hit that 2GB limit in about 26 seconds at that rate of 150MB every 2 seconds.

On some operating systems / configurations you'll get more than 2GB, up to 4GB in the best case for 32-bit code. 64-bit code will obviously not have that limit.

You could also run into fragmentation issues earlier than that due to the size of those blocks. If there's lots of memory free, but not in 50MB size pieces, you won't be able to allocate it as one block. Again this shouldn't be an issue for 64-bit code.

This topic is closed to new replies.

Advertisement