1832978 Members
2826 Online
110048 Solutions
New Discussion

Re: Kernel parameter

 
John Forbes
Occasional Advisor

Kernel parameter

is there a kernel parameter that limits the size of a file? or controls the execution of a file at around 100MB in size?
8 REPLIES 8
Mark Grant
Honored Contributor

Re: Kernel parameter

Well, to control the maximum size of a file just set "ulimit" in the users profile. There is a system wide ulimit too if you want.

Not too sure what you mean by "controls the execution of a file at around 100MB in size?"

Could you expand taht one a bit.
Never preceed any demonstration with anything more predictive than "watch this"
G. Vrijhoeven
Honored Contributor

Re: Kernel parameter

Hi,

Bisides the ulimit there is a filesystem limit if nolargefile option is used creating the filesystem. This limit is set at 2 GB. There also can be a user quota. This also is set up on the filesystem, and can be set to a number of files ( inodes) and total size of the e.g. homedir.

HTH,

Gideon
Sanjiv Sharma_1
Honored Contributor

Re: Kernel parameter

Hi John,

There is no kernel parameter for limiting the size of the file.

As advised, check "ulimit" and "quota".

If the filesystem is not configured with largefiles support than it will not allow creating a file more then 2 GB.

Thanks,
Everything is possible
John Forbes
Occasional Advisor

Re: Kernel parameter

Hi Guys,
Thanks! I appreciate your replies, however, to elaborate my concerns; is there a kernel parameter that limits the file size to be executed in an HP-UX 10.20 environment?

For example:

10MB executable file is to be executed, is there a kernel parameter that would not allow this execution?

Thanks.
G. Vrijhoeven
Honored Contributor

Re: Kernel parameter

Hi,

No, but there are kernel parameters limiting the ammount of memory a process can use.

like maxdsize maxssize maxtsize ( all _64bit aswell)

HTH,

Gideon
John Forbes
Occasional Advisor

Re: Kernel parameter

Thanks Gideon,

The kernel parameter values for the parameters that you've mention are more than the 10MB barrier they're almost close to 100MB. Therefore, that would rule-out those parameters.

Anyways, if you guys have any more suggestions then, just send me a reply.

Thanks
Bill Hassell
Honored Contributor

Re: Kernel parameter

Executables are almost always less than a few megs in size. When a process runs, it may request more memory (fairly common) and this memory is either local or shared. The HP-UX default is to limit this memory to no more than 64megs. The parameter is maxdsiz. You could change maxdsiz to 10 megs but then some HP-UX processes would not be able to run, specifically fbackup--you won't be able to backup your computer. And of course, database programs need a lot more than 10 megs so they will also fail.

So that parameter is not a ood place to limit program sizes. Instead, use ulimit -d which will prevent a program from requesting more than ###kbytes of RAM. For instance, ulimit -d 10000 will not allow programs larger than 10 megs to run. I suspect that you have specific users that are abusing the system so you can put this limit in /etc/profile and make a test to see if a specific user is logging in...if so, set the ulimt -d value. But don't set the limit for a user like oracle.

NOTE: You may be requesting this limit because an important program is failing tro run with an error that says not enough memory. Since HP-UX is a virtual memory machine, you can run programs that are too big to fit into memory. Just provide additional swap space. But there is a nother concern: 32bit programs have big problems addressing more than 900 megs of memory. See several threads here in the forums about that issue. And of course, a large program may require more than 64megs of RAM and your default value for maxdsiz may be causing the lack of memory message.

To sort all the programs by memory usage:

UNIX95= ps -e -o vsz,pid,ruser,args|sort -rn|more

This will give you an idea which programs are using memory.

And finally, a program may need shared memory but fails to identify that it needs this special memory when it gives an error. There are shared memory kernel psrsmeters that limit the maximum amount of shared memory.


Bill Hassell, sysadmin
John Forbes
Occasional Advisor

Re: Kernel parameter

Thanks Bill! I really appreciate such explanation. I'll try to do what you've suggested and give you feedback.

Regards
John