简体   繁体   中英

How to determine how much virtual memory left for my program?

I met a bad_alloc() exception. Then I attached gdb to it and called malloc_stats() :

Arena 0:
system bytes     =  171241472
in use bytes     =  171061480
Arena 1:
system bytes     =     335872
in use bytes     =     334296
Total (incl. mmap):
system bytes     = 1532186624
in use bytes     = 1532005056
max mmap regions =         44
max mmap bytes   = 1561939968

What does Arena 0 ,1 mean? Does it mean I used up all my memory? Does it mean I definitely has a memory leak somwhere? I thought every program has 4G virtual memory, the numbers listed above are no where near 4G. Is there a way to tell how much virtual memory left?

This is partially dependent upon your operating system and hardware. What hardware/OS are you running on?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM