Jump to content
  • Advertisement
Sign in to follow this  
NicoDeLuciferi

STL size of memory

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

I'm wondering if there's a way to get the actual amount of memory a STL container, or specificly map, is using? The reason for this is that, the map is allocated on a shared memory segment. And when the map grows the segment eventually "runs out" of memory.. any ideas? (that is, shared memory segment by shmget() on linux) /Nico

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by NicoDeLuciferi
I'm wondering if there's a way to get the actual amount of memory
a STL container, or specificly map, is using?

The reason for this is that, the map is allocated on a shared
memory segment. And when the map grows the segment eventually
"runs out" of memory..

any ideas?

(that is, shared memory segment by shmget() on linux)

/Nico
Wow. Um.... If you're using shared memory, then you MUST be using a custom allocator to make sure everything is allocated insinde that shared region.

So, your allcoator should know how much is left.

Share this post


Link to post
Share on other sites
The only way I can think of is with a custom allocator.

Even a really thin wrapper around malloc/free (or whatever you want to use)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!