Sponsored Content
Top Forums Shell Programming and Scripting How to clean memory after command run? Post 302895161 by postcd on Friday 28th of March 2014 06:36:45 PM
Old 03-28-2014
Quote:
Originally Posted by jim mcnamara
It sounds like you are creating child processes that continue to run. If that were not the case, the process you create (from running whatever command you have) will have released memory when it exits. I am assuming you did not write some sort of C code that creates kernel persistent objects like semaphores or shared memory and then exits without cleaning up after itself.
thx, im using just simple wget command with two its parameters..

it works, but after some time it feels like it fills the memory and fails with mentioned error...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to run multiple command in single command?

Dear Unix Guru, I have several directories as below /home/user/ dir1 dir2 dir3 Each directory has different size. I want to print each directory size (Solaris command du -hs .) Can you please guide me how to achieve this? Thanks Bala (2 Replies)
Discussion started by: baluchen
2 Replies

2. Shell Programming and Scripting

Sed command to clean xml tag

Hi, Can someone help me come up with a generic sed command to clean a tag off its attributes? For eg. Input String - <tag attrib=new>This String</tag> should undergo a sed transformation to get Output String - <tag >This String</tag> This works - echo "<tag attrib=new>This</tag>" |... (3 Replies)
Discussion started by: iamwha1am
3 Replies

3. UNIX for Dummies Questions & Answers

command to clean up file systems

As you will verify, I am a really naive user of AIX 5.1. As such I wonder if you could possibly let me know of a command or procedure I could use to automatically, globally and safely, remove all useless files from my machine. I'm not referring to my own files because I perfectly know which of them... (1 Reply)
Discussion started by: ahjchr
1 Replies

4. Programming

How to deal with lots of data in memory in order not to run out of memory

Hi, I'm trying to learn how to manage memory when I have to deal with lots of data. Basically I'm indexing a huge file (5GB, but it can be bigger), by creating tables that holds offset <-> startOfSomeData information. Currently I'm mapping the whole file at once (yep!) but of course the... (1 Reply)
Discussion started by: emitrax
1 Replies

5. Shell Programming and Scripting

Command to find the Memory and CPU utilization using 'top' command

Hi all, I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command. Thanks in advance. Thanks, Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies

6. Shell Programming and Scripting

Is command line invocation of gnome-terminal to run more than one command possible?

Hello, I am trying to learn how to pass something more than a one-command startup for gnome-terminal. I will give an example of what I'm trying to do here: #! /bin/bash # #TODO write this for gnome and xterm USAGE=" ______________________________________________ ${0##*/} run... (0 Replies)
Discussion started by: Narnie
0 Replies

7. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

8. Shell Programming and Scripting

"Cannot allocate memory" error when run from script

hi in my application there is a line with open(/dev/mydevice,0); it work good when it run manually, but when try to run it within script /////////////////////////////////////////// #!/bin/sh ./device_test 0 0 0 1 1 1 0 0 1 ///////////////////////////////////////// I receive 'Failed... (3 Replies)
Discussion started by: majeed
3 Replies

9. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

10. AIX

How to use dsadm command to run command on multi lpars?

how to run a command, such as "ls -l core" from one lpar to check multi lpars if core file exist? or what way can do a command on all lpars from one lpar? Thanks (1 Reply)
Discussion started by: rainbow_bean
1 Replies
setmemwindow(1M)														  setmemwindow(1M)

NAME
setmemwindow - change window ID of running program or start program in particular memory window SYNOPSIS
WinId] { | program [arg]... } DESCRIPTION
is the command that changes the window ID of a running process or starts a specified program in a particular memory window. If the option is specified with a nonzero pid, only the process's window ID is changed, and any value specified for program is ignored. The executable program is only executed if the process ID pid is either or unspecified. Changing the window ID for the running process does not mean the process immediately attaches to or creates objects using that window. The targeted process does not begin using the window until it executes a new image. used as a wrapper for an existing executable, starts the program in the desired (see option below) memory window. In order to execute pro- gram, changes the window ID, forks a child and executes program in the child process. The default behavior of is to wait until program finishes. If is specified, the waiting for program is bypassed and exits immediately after forking the child. If and are unspecified, the default behavior is to place the process into the window specified by WinId. If WinId exists, then the process is placed into that memory window. If no window exists with WinId, an unused window is allocated and associated with WinId. specifies the creation of a window. If the window already exists and is specified, the call fails. specifies the joining to an existing window. If the window does not exist and is specified, the call fails. The option instructs the command to execute program even if is unable to change the process's window to the specified WinId. The failure to create a specific window may be the effect of the lack of available memory windows; that is, the underlying kernel: o Has not been configured with enough memory windows (exit status o Was unable to allocate memory for a new window to meet this request (exit status or o Does not implement the feature (exit status Options Create a memory window where both memory window quadrants use the same space ID. For executables this generates two quadrants with the same space ID. Applications can use this to gen- erate the appearance of larger contiguous shared memory ranges with a maximum of 2 gigabytes. For example, an application that generates a 1 gigabyte shared memory segment has that segment placed into the 2nd quadrant by default. If the applica- tion creates another 1 gigabyte segment that segment is placed in the 3rd quadrant. Both segments are contiguous virtually, allowing the application to treat the virtual range as if it were a contiguous 2 gigabyte segment. This option only benefits executables. They are the only type of executable format able to place shared objects in the 2nd quadrant. Create a window with ID WinId and attach the specified process to it. If WinId already exists the call fails. The default behavior for is to exit without executing the user specified program if the memory window cannot be set. The failure to set the memory window may be caused by: o The lack of enough memory windows in the system. o The memory windows feature is not implemented. o The request requires a new memory window be initialized and the system was not able to allocate the memory to do so. o A memory window with WinId could not be found in the attempt to join a memory window. o A memory window with the WinId was found in the attempt to create a memory window. The option instructs to execute program whether the desired memory window was set or not. Obviously, using this option there is no guarantee program has been attached to the desired memory window and it is unclear in what memory window it is running. Using this option is strongly discouraged. Specifies the desired memory window. WinId is a key to the desired memory window. WinId is a user specified value and should be one of the values contained in the file Applications extract the user key from according to a unique string contained in using the command. (See getmemwindow(1M) and services.window(4).) The kernel tries to locate an existing window with WinId. If one is found, that window is used. If no window with WinId is found, an unused entry is located and assigned to WinId. The value for WinID is special. If specified, the process/program is placed into the default global window instead of a unique window with ID WinId. If WinID is unspecified, the process and its children will run in a private memory window, and no other processes in the system can attach to this memory window. This memory window remains active until the process and its children terminate. Join an existing window with ID WinId. The specified process attaches to an existing memory window. If no entry exists the call fails. If program is executed, the default behavior is to (see the wait(2) manual page) for the process to terminate. Specifying causes to exit after forking the child (that will execute program). Send the PID of the executed program to standard output. The message sent out is: where dddd is the decimal value of the PID. Change the memory window for process pid, or start program in the specified memory window. If program has arguments (arg ...), they must also be specified. If is unspecified or the value of pid is the calling process has its window ID changed, and program is executed. If a nonzero process pid is specified, only the window in that process is changed, and program is ignored. Execute in verbose (debug) mode. Application Usage Memory Windows helps alleviate the 1.75-gigabyte limitation on system-wide shared memory for 32-bit applications by allowing cooperating applications to configure their own 1-gigabyte window of shared resources. The definition of a memory window is only available for 32-bit processes. Note that memory windows allows the creation of more than 1.75 gigabytes of total system-wide shared memory, but it does not extend how much shared memory a single process can create. executables are still limited to 1.75 gigabytes. HP-UX ships memory windows disabled. To enable memory windows, the kernel tunable parameter, must be set to the desired number. repre- sents the number of memory windows beyond the global default window. Setting to for example, would produce a total of three memory win- dows, the default global window plus two user defined windows. Setting to leaves only the default or global memory window. There are two new commands and one file introduced by memory windows: and file. The file maps a memory window application to a particular window ID. Using this central file allows applications to share memory windows, by using the same window ID, as well as avoid unintentional memory window collisions. See services.window(4) for more information. The command is used to extract the window ID of a user process from the file. The command starts a particular process in a memory window. A common usage of these commands is to extract a memory window ID with which is then passed to to start a process with the given window ID. Processes must be in the same window to share data. Processes wanting to share global data, such as shared memory or memory mapped files, must make sure all processes are in the same memory window. If processes in different memory windows wish to share data reliably, the cre- ator of the data must take steps to guarantee the data is placed in a location accessible to all processes. For more detailed information on memory windows, refer to the RETURN VALUE
The exit value is 0 on success or a positive number on failure. If is not specified, the value is the exit status of the executed program, obtained from the system call. EXAMPLES
Start the program in a memory window extracted by the string Start the program in a newly created memory window extracted by the string Start the program in an existing memory window extracted by the string Start the program in a private memory window. Only and its descendents can access the window. WARNINGS
Programs using a memory window can access shared memory objects created by other programs using the same window (depending upon permis- sions). However, by default, programs using a memory window may not be able to access shared memory objects created by programs using other windows or those not using windows at all. To enable access to a shared memory object across programs using different windows, or between those using windows and those not using win- dows, the program must specify special options when creating the object. See shmget(2) and mmap(2) for details. AUTHOR
was developed by HP. FILES
File containing applications' associated window IDs. SEE ALSO
getmemwindow(1M), services.window(4). setmemwindow(1M)
All times are GMT -4. The time now is 04:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy