[HPADM] mallocs/virtual memory usage ..

From: Rama, Subu (srama@northropgrumman.com)
Date: Fri Oct 18 2002 - 08:45:04 EDT


Hi admins:
  I am running HP-UX 11.0 64 bit kernel and I have a 32 bit program whose
memory/virtual
memory usage I am trying to understand.

I wrote a small test program with the following results:
   char *b1, *b2, *b3;

   Steps pst_vdsize from pstat/Virtual Memory reported by
glance
1. b1 .. malloc 100 MB ... 100 MB
2. b2 .. malloc 100 MB ... 200 MB
3. b1 .. realloc 200 MB .. 400 MB .. shouldn't this be 300 MB ?
4. free (b2) .. 400 MB (I understand this. Until you exit this
will be so)
5. b3 .. malloc 300 MB .. 700 MB .. I would have thought this would be
500 MB

My question is: every malloc/realloc regardless of free seems to "linearly"
increase
the Virtual memory size.

This is causing our 32-bit program to cross the 1 GB (- stack size) limit
pretty soon.

Any hints in understanding this ?

Thank you. I will summarize.

Subu

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:21 EDT