- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Heap Memory does not shrinks even when the memory ...
Operating System - HP-UX
1822512
Members
2423
Online
109642
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2005 12:21 AM
тАО03-22-2005 12:21 AM
Hello,
I am working on C++ application on HP-UX11i. The application has a server process which allocates memory from heap at runtime and again frees it after completion of its task. since this is an server process it runs for long period of time i.e even for few weeks. As a result it keeps growing over the period even since thereis no memory leak.And
when it grows to some extent it becomes slow and boggy.
As i know that its an HP-UX OS feature that even when the memory is freed the heap does not shrinks. The freed memory is kept back to
process for future reuse.
Now my Question is there any HP patch available which actually result in shrinking of heap when memory is freed.?
Again, why my binary get slower when it becomes large in memory size as visible from top and glance plus?
Your inputs would be highly appreciated.
Thanks in advance.
Regards
I am working on C++ application on HP-UX11i. The application has a server process which allocates memory from heap at runtime and again frees it after completion of its task. since this is an server process it runs for long period of time i.e even for few weeks. As a result it keeps growing over the period even since thereis no memory leak.And
when it grows to some extent it becomes slow and boggy.
As i know that its an HP-UX OS feature that even when the memory is freed the heap does not shrinks. The freed memory is kept back to
process for future reuse.
Now my Question is there any HP patch available which actually result in shrinking of heap when memory is freed.?
Again, why my binary get slower when it becomes large in memory size as visible from top and glance plus?
Your inputs would be highly appreciated.
Thanks in advance.
Regards
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2005 01:37 AM
тАО03-22-2005 01:37 AM
Solution
This is normal memory allocation policy and it is not unique to HP-UX. It's a very typical UNIX method of handling "free()'ed" memory. The memory is made available for subsequent reuse by the same process but is not returned to the OS. There is a method that will return the memory BUT you must take over the full job of memory allocation; you cannot use malloc(), calloc(), realloc(), new() -- so this is probably not practical especially for C++. The key to doing this is the sbrk() system call. It's what underlies malloc(), new(), et al. The argument to sbrk can be positive (allocate memory) or negative (deallocate memory).
As to why your program execution slows when the process size is large. You wrote it; don't you know? Possible reasons include: 1) Longer times to search through larger data structures 2) Inefficient algorithms 3) Total system memory use may have grown so large that the system is now paging significantly.
As to why your program execution slows when the process size is large. You wrote it; don't you know? Possible reasons include: 1) Longer times to search through larger data structures 2) Inefficient algorithms 3) Total system memory use may have grown so large that the system is now paging significantly.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2005 03:33 PM
тАО03-23-2005 03:33 PM
Re: Heap Memory does not shrinks even when the memory is freed
Thanks for the response Stephenson.
As u mentioned that one of the reason for slowness of the binary could be "the system paging significantly".
So, Is there any possibility that the process freed memory pages does pageout ??
why i m asking this question is my binary becomes very big after running for say 2-3 weeks and then becomes irreversible slow.When killed and started again, it becomes fast but that for a week and again becomes slow. So, this slowness can be attributed to the pageout even for the freed memory.
Thanks & Regards.
As u mentioned that one of the reason for slowness of the binary could be "the system paging significantly".
So, Is there any possibility that the process freed memory pages does pageout ??
why i m asking this question is my binary becomes very big after running for say 2-3 weeks and then becomes irreversible slow.When killed and started again, it becomes fast but that for a week and again becomes slow. So, this slowness can be attributed to the pageout even for the freed memory.
Thanks & Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-24-2005 02:25 AM
тАО03-24-2005 02:25 AM
Re: Heap Memory does not shrinks even when the memory is freed
Remember the OS doesn't have a clue (or care) that your dynamically allocated memory has been free()'ed. From the perspective of the OS, all free() has done is move memory from one internal (to the process) data structure to another. What is possible, it that TOTAL system memory use including your big process has grown so large that the system as a whole has to page. When your process gets sluggish, do a vmstat and look at the po (pageout) rates. If the pageout rate is high (above 10-20) for significant periods of time (minutes) then your system is definitely under memory pressure. You really should run tusc against your process when it is sluggish. You could then see what system calls are getting hammered.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP