Sponsored Content
Full Discussion: Memory/virtual space
Top Forums Shell Programming and Scripting Memory/virtual space Post 10898 by Perderabo on Friday 23rd of November 2001 08:44:46 AM
Old 11-23-2001
Re: Further information

Quote:
Originally posted by degwright
Perderabo,
Thanks for the information you have provided so far, but I have to take this further.

I have to assume from the evidence to date that the sys vars are taking up space which prevents the 'ls' command from working correctly.
Hmmm...you seem to be correct. To paraphrase a great American statesman, my previous guess is no longer operative...

If you do a "man 2 exec" and look at the errors that can occur. In particular, the kernel can return
Quote:
E2BIG - The number of bytes in the new program's argument list plus environment is greater than the system-imposed limit. This limit is at least 5120 bytes on HP-UX systems.
I assume, of course, that you will completely ignore the documented limit of 5120 and will experimentally determine the maximum you can achieve today. Smilie

So where does this leave you? If your developers develop more programs your script is going to fail. You seem to realize this. I'm not sure that you realize that an OS patch or upgrade could do the same thing.

I must expand my recommendation to you. Not only must you write code that will keep command lines under 2048 bytes, you also need to ensure that the command line plus the environment are less than 5120 bytes. I'm glad we cleared that up! Smilie

You're apparently unwilling to consider coding techniques that do not put all file names in one command line. Well, there is another approach. You could segment your project so that there are many small directories instead of one large one. This would render your code safe. But also, large directories slow unix down since they must be searched sequentially.

These really are the only options I see for you. Sorry for the bad news.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

virtual memory

Hi, can anyone explain me what virtual memory is ( for which we use vmstat commande line ) comparing with RAM ? many thanks before. (2 Replies)
Discussion started by: big123456
2 Replies

2. Programming

about virtual memory and memory leak

Hi, First of all I appreciate this group very much for its informative discussions and posts. Here is my question. I have one process whose virtual memory size increases linearly from 6MB to 12MB in 20 minutes. Does that mean my process has memory leaks? In what cases does the... (4 Replies)
Discussion started by: shriashishpatil
4 Replies

3. Programming

how allocate virtual memory

Hi Folks can any body suggest how to allocate virtual memory any function for that (2 Replies)
Discussion started by: munnu
2 Replies

4. HP-UX

Virtual Memory

Hi! I work with HP-UX and I have to monitorize the use of virtual memory for different processes. (java processes for Tibco Adapter) And if these processes exceed a limit send a message to the syslog. I donīt know how to monitorize this... Should I do a script? or use an aplication, for example... (3 Replies)
Discussion started by: Kurohana
3 Replies

5. AIX

ulimits max locked memory virtual memory

Hi, Would any one be so kind to explain me : are ulimits defined for each user seperately ? When ? Specialy what is the impact of : max locked memory and virtual memory on performance of applications for a user. Many thanks. PS : this is what I can see in MAN : ulimit ] ... (5 Replies)
Discussion started by: big123456
5 Replies

6. UNIX for Dummies Questions & Answers

cpu, memory and virtual memory usage

Hi All, Does anyone know what the best commands in the UNIX command line are for obtaining this info: current CPU usage memory usage virtual memory usage preferably with date and time parameters too? thanks ocelot (4 Replies)
Discussion started by: ocelot
4 Replies

7. UNIX for Dummies Questions & Answers

Virtual Memory

Hi, Can anyone please help me workout how much virtual memory I have running on a T2000 running Solaris 10. Thanks # df -h swap 3.5G 1.0M 3.5G 1% /etc/svc/volatile swap 3.5G 208K 3.5G 1% /tmp swap 3.5G 56K ... (2 Replies)
Discussion started by: jamba1
2 Replies

8. UNIX for Advanced & Expert Users

Virtual file or memory?

Hi Experts I encountered a situation recently. I wanted to discuss here and understand the reason behind this. My scenario is something like this: yes > temp & The above command keeps writing the output to the file temp. And this file keeps growing every second. And in the every... (4 Replies)
Discussion started by: guruprasadpr
4 Replies

9. Solaris

Virtual Memory explanation

Hi All, Please explain me about Virtual Memory. Regards, SKumar (1 Reply)
Discussion started by: nskumar
1 Replies

10. UNIX for Beginners Questions & Answers

Virtual Memory in UNIX

So, I would ask you a piece of advice about which books or titles could give me comprehensive information about virtual memory in UNIX. Especially, I would found out that virtual address translation corresponds structures of kernel! Thanks! (2 Replies)
Discussion started by: Fadedfate
2 Replies
GETRLIMIT(2)						      BSD System Calls Manual						      GETRLIMIT(2)

NAME
getrlimit, setrlimit -- control maximum system resource consumption SYNOPSIS
#include <sys/types.h> #include <sys/time.h> #include <sys/resource.h> int getrlimit(int resource, struct rlimit *rlp); int setrlimit(int resource, const struct rlimit *rlp); DESCRIPTION
Limits on the consumption of system resources by the current process and each process it creates may be obtained with the getrlimit() call, and set with the setrlimit() call. The resource parameter is one of the following: RLIMIT_CORE The largest size (in bytes) core file that may be created. RLIMIT_CPU The maximum amount of cpu time (in seconds) to be used by each process. RLIMIT_DATA The maximum size (in bytes) of the data segment for a process; this defines how far a program may extend its break with the sbrk(2) system call. RLIMIT_FSIZE The largest size (in bytes) file that may be created. RLIMIT_MEMLOCK The maximum size (in bytes) which a process may lock into memory using the mlock(2) function. RLIMIT_NOFILE The maximum number of open files for this process. RLIMIT_NPROC The maximum number of simultaneous processes for this user id. RLIMIT_RSS The maximum size (in bytes) to which a process's resident set size may grow. This imposes a limit on the amount of physical memory to be given to a process; if memory is tight, the system will prefer to take memory from processes that are exceeding their declared resident set size. RLIMIT_STACK The maximum size (in bytes) of the stack segment for a process; this defines how far a program's stack segment may be extended. Stack extension is performed automatically by the system. A resource limit is specified as a soft limit and a hard limit. When a soft limit is exceeded a process may receive a signal (for example, if the cpu time or file size is exceeded), but it will be allowed to continue execution until it reaches the hard limit (or modifies its resource limit). The rlimit structure is used to specify the hard and soft limits on a resource, struct rlimit { rlim_t rlim_cur; /* current (soft) limit */ rlim_t rlim_max; /* hard limit */ }; Only the super-user may raise the maximum limits. Other users may only alter rlim_cur within the range from 0 to rlim_max or (irreversibly) lower rlim_max. An ``infinite'' value for a limit is defined as RLIM_INFINITY. Because this information is stored in the per-process information, this system call must be executed directly by the shell if it is to affect all future processes created by the shell; limit is thus a built-in command to csh(1) and ulimit is the sh(1) equivalent. The system refuses to extend the data or stack space when the limits would be exceeded in the normal way: a break call fails if the data space limit is reached. When the stack limit is reached, the process receives a segmentation fault (SIGSEGV); if this signal is not caught by a handler using the signal stack, this signal will kill the process. A file I/O operation that would create a file larger that the process' soft limit will cause the write to fail and a signal SIGXFSZ to be generated; this normally terminates the process, but may be caught. When the soft cpu time limit is exceeded, a signal SIGXCPU is sent to the offending process. RETURN VALUES
A 0 return value indicates that the call succeeded, changing or returning the resource limit. A return value of -1 indicates that an error occurred, and an error code is stored in the global location errno. ERRORS
Getrlimit() and setrlimit() will fail if: [EFAULT] The address specified for rlp is invalid. [EPERM] The limit specified to setrlimit() would have raised the maximum limit value, and the caller is not the super-user. SEE ALSO
csh(1), sh(1), quota(2), sigaction(2), sigaltstack(2), sysctl(3) HISTORY
The getrlimit() function call appeared in 4.2BSD. 4th Berkeley Distribution June 4, 1993 4th Berkeley Distribution
All times are GMT -4. The time now is 09:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy