Operating System - Linux
1748230 Members
4297 Online
108759 Solutions
New Discussion юеВ

Re: Memory Allocation Failure Error

 
Anoop Ahamad
Occasional Advisor

Memory Allocation Failure Error

What's the different possibilities of getting a memory allocation Failure error?

One of the process got failed during the process of allocating a small amount of memory (less than 10 MB). I don't know the exact memory usage at that particulat moment,but when I monitored the system continuously after that there's enough memory available. The top output shows that
Total Memory available : 78 GB
Memory Cached : 73 GB
Memory free : 255MB

So I think there was enough memory when the process crashed and it's failed due to some other reason. So I would like to know the different reasons for gettign this error.
5 REPLIES 5
Suman_1978
HPE Pro

Re: Memory Allocation Failure Error

Hi Anoop,

Kindly let us know the following:
What is the Operating System/Kernel?
What is the process that failed?
What is the server hardware model?

These things will help us to answer your query.

Thanks.

I work for HPE.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]

Accept or Kudo

Anoop Ahamad
Occasional Advisor

Re: Memory Allocation Failure Error

The OS is RHEL release 4 (Nahant Update 6)
Kernel version is 2.6.9-67
Platform is X86_64
The process was a C++ program.
Lucifer Megacruel
Valued Contributor

Re: Memory Allocation Failure Error

Hi Anoop,

You are allocating memory using malloc /new right ? or some other wierd way by using sbrk() or something ? . I will take a look at the lidstdc++, linux kernel code and get back to you.

It would be nice to check the errno variable. Theoretical answer is fragmentation :).

--Lucifer Megacruel
"To Denouce the Evils of Truth and Love. To cause may hem and destruction and necromancy , Lucifer is here"
Pramod Kumar M
Advisor

Re: Memory Allocation Failure Error

Hi,

As per your TOP comand output 93% of your RAm used as cached memory. Can you reduce that?

I myself don't know how to reduce cached memory but article may help you out

http://www.scottklarr.com/topic/134/linux-how-to-clear-the-cache-from-memory/

Regards,
Pramod.
Anoop Ahamad
Occasional Advisor

Re: Memory Allocation Failure Error

I had googled for the cache usage and most of the articles says that it's an advantage in Linux that the free memory will be utilized by using as cache and it will improve the system performance. And there's no issue with memory because the requested memory will be moved from cache and will be allocated to the requested process.

So in my case there was enough memory(cache) but it couldn't allocate it to the process. Is there any restriction in allocating memory from cache?