Jump to content
  • Advertisement
Sign in to follow this  
rldivide

memory limit on gcc/g++/MingW

This topic is 3345 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

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 ?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!