Sign in to follow this  
NicoDeLuciferi

STL size of memory

Recommended Posts

NicoDeLuciferi    168
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
C-Junkie    1099
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
C-Junkie    1099
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this