Discussion:
[omniORB] High heap memory consumption due to omni layer memory management [OMNI ORB version 4.1.4]
Agarwal, Shelendra
2014-07-17 11:29:45 UTC
Permalink
Hi All,
We are facing a problem where the memory consumed by application is growing very high and the consumed memory not getting released even if required work is complete. The memory management of this application is mainly driven by Omni ORB [OMNI ORB version 4.1.4]
Our server side application (in C++) acts as servant application which queries DB and fetches records and then fills a CORBA sequence. Then the requester application (here Omni ORB) takes care of delivering that data to User interface layer (written in VC++).
Now omni is the intermediate layer working between our core server application (say querying from DB) and our UI. So we are depending on omni CORBA sequence completely for the memory allocation and de-allocation
We are seeing from the glance command that: during this process the heap memory (acquired for CORBA sequences in consideration) is growing to an extent proportionately with the number of records we are operating or fetching from DB. But then it never goes down even if the data is surrendered to UI by omni. Initially we thought this as a leak but then realized that the memory growth is not consistently happening. Assume that we have fetched say 10000 records from DB and returned back to UI through omni. Then subsequently if we are querying a small section of data, then memory does not grow further. It appears that omni uses a different kind of memory management as opposed to traditional new/delete. Because the memory address used in the first iteration is getting re-used in the second iteration. However that consumed memory does not come down at all.
Also we are even seeing at times that: if the UI logged in user is different and the request to query DB goes to a different application thread, then again for that thread, memory is allocated from heap. Overall we are seeing that a huge amount of memory is being allocated and reserved for its operation instead of releasing it after the request has been served. The issue here is the memory usage grows up very high.
The leak detector tools are clearly telling that, there are no leaks in our application or in omni. With this we are getting an impression that it's a different kind of memory management technique. But then the concern is, for each serving thread if it allocates good amount of heap memory and keep with it as working area/memory then we are running out of resources.
Please highlight if there is any design glitches (or any recommendations)

Thanks & Regards,



Shelendra Agarwal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20140717/4662e5ae/attachment.html>
Duncan Grisby
2014-07-18 14:38:58 UTC
Permalink
On Thu, 2014-07-17 at 11:29 +0000, Agarwal, Shelendra wrote:

[...]
Post by Agarwal, Shelendra
The leak detector tools are clearly telling that, there are no leaks
in our application or in omni. With this we are getting an impression
that it?s a different kind of memory management technique. But then
the concern is, for each serving thread if it allocates good amount of
heap memory and keep with it as working area/memory then we are
running out of resources.
omniORB does not do anything special with memory management. It just
uses new and delete.

What you describe is actually a common way for system memory allocators
to behave. They allocate large blocks of memory from the OS, and then
keep hold of it without giving it back to the OS. You don't say what
platform your server is using, but you may find there are some platform
configuration options that affect the bahaviour of the memory allocator.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
Sahoo, Dibendu Kumar
2014-08-05 10:32:49 UTC
Permalink
Hi Duncan/All,

Could you please let us know on " platform configuration parameters options for memory allocator" . It would really help us. If we can bring back the memory acquired by OS by means of some configuration change , then it would be really great. We are seeing that memory is acquired/consumed ( same way as explained by you ) but it is never going down/released.

Thanks in advance.

Regards
Dibendu

-----Original Message-----
From: Sahoo, Dibendu Kumar
Sent: Friday, July 25, 2014 9:50 AM
To: 'Duncan Grisby'; Agarwal, Shelendra
Cc: omniorb-list at omniorb-support.com; Vijayan, Pratheesh T (Enterprise Services - CMS); Thondapu, Chennarao; Rani, Chandrika M; Sahoo, Dibendu Kumar; Bhatia, Neeraj
Subject: RE: [omniORB] High heap memory consumption due to omni layer memory management [OMNI ORB version 4.1.4]

Hi Duncan ,

Thanks a lot for your response.
Post by Agarwal, Shelendra
They allocate large blocks of memory from the OS, and then keep hold of it without giving it back to the OS .
We are in HP-UX Itanium platform. What we are seeing is : memory is being acquired by the thread during the business action. But it does not get released even if the operation is finished. Or in other words, for filling say around 10000 records, memory from heap has been acquired by omni ORB ,but once those records are rendered/dispatched to UI, that memory already acquired during this operation is not coming down. This behavior is little surprising. We were thinking that memory usage will be more during the operation and will come down after it and again go up for the subsequent iterations/operations.


You have mentioned about some platform configuration parameters options for memory allocator. Could you please let us know what are they. It would be really helpful for us.


Thanks & regards
Dibendu

-----Original Message-----
From: Duncan Grisby [mailto:duncan at grisby.org]
Sent: Friday, July 18, 2014 8:09 PM
To: Agarwal, Shelendra
Cc: omniorb-list at omniorb-support.com; Vijayan, Pratheesh T (Enterprise Services - CMS); Thondapu, Chennarao; Sahoo, Dibendu Kumar; Rani, Chandrika M
Subject: Re: [omniORB] High heap memory consumption due to omni layer memory management [OMNI ORB version 4.1.4]

On Thu, 2014-07-17 at 11:29 +0000, Agarwal, Shelendra wrote:

[...]
Post by Agarwal, Shelendra
The leak detector tools are clearly telling that, there are no leaks
in our application or in omni. With this we are getting an impression
that it?s a different kind of memory management technique. But then
the concern is, for each serving thread if it allocates good amount of
heap memory and keep with it as working area/memory then we are
running out of resources.
omniORB does not do anything special with memory management. It just uses new and delete.

What you describe is actually a common way for system memory allocators to behave. They allocate large blocks of memory from the OS, and then keep hold of it without giving it back to the OS. You don't say what platform your server is using, but you may find there are some platform configuration options that affect the bahaviour of the memory allocator.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
Loading...