1847334 Members
2221 Online
110264 Solutions
New Discussion

Memory Allocation Error

 
Andrianto Tjandra
Occasional Advisor

Memory Allocation Error

I have C3700 with 2 GB physical Memory and 4 GB swap space. But recently I got an error messsage "Memory Allocation error". As far as I know this error message has something to do with the memory and swap space. When I checked the System Properties using SAM, I saw that the swap space was used only 2 GB and the other 2 GB of swap space was free. Why? Is there any kernal configuration or so for being able to use the whole 4 GB swap space?

I appreciate very much for your response.

Best regards
A. Tjandra
9 REPLIES 9
Kent Ostby
Honored Contributor

Re: Memory Allocation Error

There are two issues here.

The first one is the error message which I'm not sure about but will look up.

The second one has to do with only half of the swap space being used.

In general a good bit of swap space is used simply reserving swap space in case swapping is necessary.

This is probably the half of the "used" swap space that you are seeing.

I will research the "Memory ALlocation error" further.

Where did you see this error ?

Was it in syslog or was it during bootup or somewhere else ?

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Kent Ostby
Honored Contributor

Re: Memory Allocation Error

Andrianto --

Please do give more details as to where you saw this error message.

Looking around for possible solutions, it could be something as basic as a memory related kernel parameter (such as maxdsiz) or it could be something specific to an application.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Steven E. Protter
Exalted Contributor

Re: Memory Allocation Error

I recommend monitoring with glance/gpm to see if you really have a swap issue.

You can also monitor swap with vmstat or the utility scripts I am attaching.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrianto Tjandra
Occasional Advisor

Re: Memory Allocation Error

Hi Kent,

The "Memory Allocation error" poped up while I was running a CAM application software.

Best regards
Andrianto
Bill Hassell
Honored Contributor

Re: Memory Allocation Error

Since this is a large memory program, start by increasing the kernel parameter maxdsiz to the largest value for a 32bit program (about 1750 megs). Now your program cannot use this much memory unless it was compiled correctly. Otherwise, it will use up to 960megs. Because your program issued a very general message, we cannot determine if the memory is local to the program or is referring to shared memory. Only the author of the program can tell you about shared memory requirements. 32bit programs have severe limitations for both local and shared memory. If the program uses shared memory, the shared memory area is probably fragemented or has orphaned segments (see: ipcs -bmop) caused by using kill -9 or programming errors that crash the program. A reboot will clear up fragmentation.


Bill Hassell, sysadmin
Andrianto Tjandra
Occasional Advisor

Re: Memory Allocation Error

Hi Bill,

this is the current setting for maxdsiz=3221225472 (default value). How much is this number in megs? Your suggestion for setting to the largest value for a 32bit program about 1750 megs, what number should I set? Another word how to calculate the number I have to set for maxdsiz?

Best regards
Andrianto
Bill Hassell
Honored Contributor

Re: Memory Allocation Error

You wrote:

> this is the current setting for maxdsiz=3221225472 (default value).

Actually, this is not the default value at all. The default has historically been 0x4000000 (that's a hex number, translated to decimal = 67108864 or 67 megs using 1000*1000=1meg, 64 megs using 1024*1024). For 11.11 (latest versions), the value is now defaulted to 0x10000000 or 268435456, about 256megs using 1024 for Kbyes.

> How much is this number in megs?

The unit of measure is bytes, so your 3221225472 value is 3,221,225,472 or 3Gb. No 32bit program can reach this value due to addressing limits. It's OK to leave the value--it is simply a fence to limit possible runaway programs from using too much memory.

> Your suggestion for setting to the largest value for a 32bit program about 1750 megs, what number should I set? Another word how to calculate the number I have to set for maxdsiz?

1750megs is 1750000000. SAM knows about hex numbers as well as decimal--I prefer decimal although it's unfortunate that the unit of measure is bytes...the numbers are so long that it's easy to add or lose a digit.

Now all of this is just background because your current limit is 3Gb, more than enough for any 32bit program. As mentioned, your program is running out of memory due to addressing limitations, not lack of RAM. With 4Gb of swap space, you have more than enough swap for any reasonable quantity of programs to run at the same time.

What happens after you reboot? Do you get the same error with the same inputs to the program? Check if your program is using shared memory with the command:

ipcs -bmp

This shows chunks of RAM that have been allocated by the program with a process ID number (PID) of CPID, and the last process to attach to this segment of RAM is LPID. When your process starts running, see if ipcs -bmp shows an entry with CPID = your_program. If true, then your program does indeed use shared memory and you'll need to increase the kernel parameter shmmax from the default of 64megs (0x4000000 just like maxdsiz) to perhaps 256 megs (change 0x4000000 to 256000000). The kernel will be rebuilt and rebooted. Now try your program again. Ideally, the author/mfr of the program can tell you these details too.


Bill Hassell, sysadmin
Rita C Workman
Honored Contributor

Re: Memory Allocation Error

Andrianto,

Since that parm is set so high, could you post your kernel parms current values...it might also add to the picture..

Rgrds,
Rita
Andrianto Tjandra
Occasional Advisor

Re: Memory Allocation Error

Hi Rita,

attached are the kernal params.

Regards
Andrianto