Operating System - HP-UX
1822741 Members
3920 Online
109644 Solutions
New Discussion юеВ

Re: ulimit (out of memory prblm)

 
guru_1
Frequent Advisor

ulimit (out of memory prblm)

I am geeting out of memory probelm in HP when i am running one application.When i give ulimit it says 4194303..I suspect its a ulimit probelem How to increase that value to unlimited.

28 REPLIES 28
Steve Steel
Honored Contributor

Re: ulimit (out of memory prblm)

Hi


The minimum, maximum, and default ulimit values are based on certain
kernel parameters.

For the Korn shell (ksh), ulimit only affects the filesize limit
which defaults to 4194304, and this is the ksh value for unlimited.

For the POSIX shell (sh), there are several variables that can be set
with ulimit. The 'ulimit -a' command lists the variables that can be
set for the posix shell.

Note: See the sh-posix(1) man page. There are soft and hard
limits for these variables.

Soft Limit:
-----------

$ ulimit -aS
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 65536 max determined by maxdsiz
stack(kbytes) 8192 max determined by maxssiz
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 60 max determined by maxfiles

Hard Limit:
-----------

$ ulimit -aH
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 65536
stack(kbytes) 8192
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) 1024 max determined by maxfiles_lim

The C shell (csh) has similar variables. These variables are set by
the csh limit command.

Note: See the csh man page.



Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

So i that case i have the unlimited value.But I am getting the out of memmory problem .My machine is 4 gb Ram.But it is not being used fully ...i checked up using glance .So is there any kernel param which limits that ??


James R. Ferguson
Acclaimed Contributor

Re: ulimit (out of memory prblm)

Hi:

Knowing the specific error you received would be helpful. As already noted, 'maxdsiz' and 'maxssiz' are two very important kernel parameter fences for consumption of overall memory by any process. Swapspace may also be an issue if an application is "out-of-memory". Please provide the specific error (or number) you received and the output from:

# swapinfo -ta

Regards!

...JRF...
Steve Steel
Honored Contributor

Re: ulimit (out of memory prblm)

Hi


Please install the latest shell patches for your O/S. ksh csh posix-sh

There are some differences there


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

1)Where i can find the shell patches ???

2)The explanation of the error is

I have one scrpt which starts my weblogic server.Now in that script there is parameter to define java command line options top start memory and max memeory with which the weblogic server shud run.Now when i set both these params to 256 mb then the servers comes up and when i put it 512 mb it throws a error ...out of memory.

3)Is there any file in HP like /etc/security/limits in AIX which sets the limits.
Bill Hassell
Honored Contributor

Re: ulimit (out of memory prblm)

As mentioned, ulimit in ksh has no parameters and does not refer to memory at all...it is the maximum number of blocks that can be written to a file. Use the POSIX shell instead so more details can be determined about your problem.

Out of memory can mean many different things. To start, use the POSIX shell and type ulimit -aS to determine the size of the allowed data area. If it says 65536, then the default kernel fence for large programs is still set to 65 megs and the kernel must be changed.

Another memory limitation is the shared memory area and this is often the error seen for 32bit applications. 32bit applications are bound to the shared data area...1 Gb by default, with some 'MAGIC', they can address up to 1.75Gb, even 2.75Gb, but this area is shared by many other pieces of the system, things like memory mapped files, shared libraries and shared memory areas used by other programs. Once the system gets busy, this area can become fragmented and no free space exists that is large enough for the program's request.

Read the white papers about memory and program management in /usr/share/dov, specifically, mem_mgt.txt and proc_mgt.txt. And get a copy of the shminfo program from:

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/

The weblogic program sounds like the memory it needs is not shared, so the kernel parameter is maxdsiz and should be increased to about 900 megs to avoid future problems.

You did not mention the HP-UX version. 10.20 cannot use all of the 4Gb...just 3.75Gb, while 64bit HP-UX version 11.0 can address terabytes of RAM. However, applications must be written to accomodate the extended memory availability.


Bill Hassell, sysadmin
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

I used the posix shell and the result of ulimit -aS

time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 65536
memory(kbytes) unlimited
coredump(blocks) 4194303
nofiles(descriptors) 1024


Does it say anything ??
Bill Hassell
Honored Contributor

Re: ulimit (out of memory prblm)

So ulimit indcates there is nothing in the environment to limit the data area. Use the command:

sysdef | grep maxdsiz

and see if the number of pages is 16384 (which is 65 megs where page=4k), or if maxdsiz is less than 100000 (100k) which is less than 500 megs. Or you can just run SAM, select kernel parameters and maxdsiz, and change maxdsiz to 235000 (235k) which is about 900 megs. Then after the system reboots, you should be able to run weblogic with a 512 option.


Bill Hassell, sysadmin
Steve Steel
Honored Contributor

Re: ulimit (out of memory prblm)

Hi
Ttest the Hard Limit as I showed in my first response.ulimit -aH

It looks to me as thought you should increase maxdsiz and maxssiz by at least 50% and probably a lot more.



maxdsiz Max Data Segment Size (bytes)


maxssiz Max Stack Segment Size (bytes)


use size -d and man size to see what your program has available.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

# sysdef|grep maxdsiz
maxdsiz 262144 - 0-655360 Pages -
maxdsiz_64bit 966367641 - 256-1048576 Pages


here is the o/p .Plus i just ran glance it says memory usage as 90 %. ?????? is this the problem.Plus is there any file ion HP (like /etc/limits) which limits the use of resources...are the resources to users are limited only by kernel params ????//
harry d brown jr
Honored Contributor

Re: ulimit (out of memory prblm)

I'm running weblogic on a server, and I have my kernel parameter maxdsiz set to 0x40000000 which is 1073741824

Also, I have maxssiz set to 0x800000 which is 8388608, and maxtsiz to 0x4000000 which is 67108864.

Also, WHAT OS are you running? (10.20, 11.00, 11i)??


live free or die
harry
Live Free or Die
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

/home1/vishal>ulimit -aH
time(seconds) unlimited
file(blocks) unlimited
data(kbytes) 1048576
stack(kbytes) 65536
memory(kbytes) unlimited
coredump(blocks) unlimited
nofiles(descriptors) 2048


This is my o/p How to use size -d ...what does it do..how do i find what my program has avalable.
harry d brown jr
Honored Contributor

Re: ulimit (out of memory prblm)

If you limit the amount of memory a user can use, then that user runs the risk of their application dying, especially when you make the limits below the defaults. In AIX the limits file in my opinion is CUTE, but I wouldn't want to MICRO-manage every single user, or for that matter a group (class) of users.

Other than weblogic on your server, what other kind of apps are used?

live free or die
harry
Live Free or Die
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

# grep maxssiz system
maxssiz 0X04000000
maxssiz_64bit 0X04D00000
# grep maxtsiz system
maxtsiz 0X40000000

I use 11.0 and as of now only weblogic is runing.No other apps are running.I use iplanet server also.

I have 4 GB RAM nd its showing 95% memory used in glance.
Steven Gillard_2
Honored Contributor

Re: ulimit (out of memory prblm)

Having 95% physical memory usage in itself will not cause the problem. How much swap space do you have available? Can you post output to swapinfo -atm?

How large is the processes data segment size growing before it crashes? You can monitor this with top or glance. Is it possible to get a tusc trace of the process as it crashes?

Regards,
Steve
Bill Hassell
Honored Contributor

Re: ulimit (out of memory prblm)

You wrote:

>Plus i just ran glance it says memory usage as 90 %. ?????? is this the problem.Plus is there any file ion HP (like /etc/limits) which limits the use of resources...are the resources to users are limited only by kernel params ?<

Memory usage in Glance is not meaningful until you break it out: part of the memory usage is the buffer cache, and it's probably way too large. Change the kernel parameter dbc_max_pct to 15 rather than 50. While it is supposed to be dynamic, it takes some coaching to make it shrink.

In Glance, type the letter ? to see all the 1-char commands, then type m to look at the memory summary. The buffer cache should be about 300-600 megs or less.

To answer the last question, no, there is no /etc/default file to limit RAM other than the kernel.

Also, maxssiz rarely needs changing. At 8 megs, a poorly written program might need help by increasing it but for a 32 bit program, it will be limited to 80 megs on 10.20 and 200 megs on 11.0. However, 'normal' programs will complain about lack of stack memory rather than just memory.

Note also that you should look at swapinfo -tm to see if you have enough virtual memory space.


Bill Hassell, sysadmin
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

# swapinfo -atm
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 1024 172 852 17% 0 - 1 /dev/vg00/lvol2
dev 3072 0 3072 0% 0 - 2 /dev/vg00/lvol9
reserve - 1870 -1870
memory 3141 2318 823 74%
total 7237 4360 2877 60% - 0 -


here is the o/p
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

Hi Bill,
i did that by buffer cache is 2 GB.


Steve Steel
Honored Contributor

Re: ulimit (out of memory prblm)

Hi


A question.

What application gives the problem and how is it built.

Does it go wrong quickly or after a while.


Watch it run in glance and see if it grows.
You may have some form of memory leak.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Steven Gillard_2
Honored Contributor

Re: ulimit (out of memory prblm)

Kuls,

One of your responses indicates its a java program generating the error. If thats the case the max_thread_proc and nkthread parameters could also be the problem. See http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/configuration.html for more information.

It would help immensely if you could post the exact text of the error you are receiving.

Regards,
Steve
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

Resources PID: 5605, native_thread PPID: 5599 euid: 521 User: vsoral
--------------------------------------------------------------------------------
CPU Usage (sec) : 0.08 Log Reads : 0 Rem Log Rds/Wts: 0/ 0
User/Nice/RT CPU: 0.07 Log Writes: 0 Rem Phy Rds/Wts: 0/ 0
System CPU : 0.00 Phy Reads : 0
Interrupt CPU : 0.00 Phy Writes: 0 Total RSS/VSS :563.2mb/583.5mb
Cont Switch CPU : 0.00 FS Reads : 0 Traps / Vfaults: 4/ 0
Scheduler : HPUX FS Writes : 0 Faults Mem/Disk: 0/ 0
Priority : 154 VM Reads : 0 Deactivations : 0
Nice Value : 24 VM Writes : 0 Forks & Vforks : 0
Dispatches : 27 Sys Reads : 0 Signals Recd : 0
Forced CSwitch : 2 Sys Writes: 0 Mesg Sent/Recd : 1/ 0
VoluntaryCSwitch: 20 Raw Reads : 0 Other Log Rd/Wt: 1/ 1
Running CPU : 0 Raw Writes: 0 Other Phy Rd/Wt: 0/ 0
CPU Switches : 0 Bytes Xfer: 0kb Proc Start Time
C - cum/interval toggle % - pct/absolute togglen 9 18:45:30Page 1 of 1



These are the details about the process taken from glance.which is running webogic.

Bill Hassell
Honored Contributor

Re: ulimit (out of memory prblm)

As mentioned, the buffer cache is way too big. You'll have to change dbc_max_pct to 15 and rebuild the kernel.

Another possibility is that weblogic is using shared memory which has a different set of limitations. The weblogic application must document what it needs in shared memory, memory mapped files, semaphores, etc as these are application-dependent and cannot be guessed.

If weblogic uses shared memory, start with:

# ipcs -bmop

and see how big the segments are for the weblogic program. If they are fairly large (10's to 100's of megs), then you probably have shared memeory fragmentation due to weblogic being a 32bit program. To see the details, get a copy of shminfo:

ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/programs/shminfo/

abd read the white paper on memory windows in /usr/share/doc. If you don't have the paper, you are not up to date on patches for 11.0.


Bill Hassell, sysadmin
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

The exact error is
The WEBLOGIC server goes down saying "OUT OF MEMORY"
guru_1
Frequent Advisor

Re: ulimit (out of memory prblm)

Hi Bill,
U mean to say that i should deifine
dbc_max_pct=15 in /stand/system which is not deifines at present and that is the reason it is taking its default value of 50.

thnks