Sponsored Content
Full Discussion: Memory Leaks
Top Forums Programming Memory Leaks Post 302721443 by Don Cragun on Thursday 25th of October 2012 11:56:17 AM
Old 10-25-2012
All memory allocated by a process is returned to the system when the process terminates.

A very small amount of memory will remain after the process terminates that indicates the status of the terminated process. That memory will be released when the process that started the terminated process either gathers the exit status of its dead child (by calling something like wait()) or terminates.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

memory leaks

Hi!! Experts, Any ideas how to check for the memory leaks in a process during performance testing?? I dont use purify.. Any way of finding it out using default S/W in HP UX-11 Can U gimme pointers to site having good scripts/tutorials on performance testing?? Thanx in Advance.. :) (3 Replies)
Discussion started by: jyotipg
3 Replies

2. HP-UX

Memory leaks on HP-UX 11i

Hi folks, We are using following listed configurations for a particular application. HP-UX 11i Sun Java 2 SDK Standard Edition 1.4.1 (version shipped with WebLogic 8) Oracle 9i Release 2 (Oracle 9.2.0) BEA WebLogic Server 8.1 SP3 It seems a memory leak when we use above configurations.... (1 Reply)
Discussion started by: gimhan90
1 Replies

3. Programming

Tool for finding memory leaks

hi, i am a c++ programmer working on linux(redhat linux8.0) environment, i need to find out the memory leaks, so far i didn't used any tools, so what are the tools are available, and whic one is good to use. plz provide with a small example. (1 Reply)
Discussion started by: sarwan
1 Replies

4. UNIX for Advanced & Expert Users

strange problem with memory leaks

Hi Unix lovers, I am facing a strange problem about memory leak. One component of our product show memory leak at customer's end but not in development environment. The memory used by the exe goes on increasing at customer end but not in dev. customer has same m/c(HP unix 11i) , the same... (1 Reply)
Discussion started by: shriashishpatil
1 Replies

5. Shell Programming and Scripting

Find memory leaks shell script ???

Hi all, Has anyone out there a shell script to detect memory leaks on unix machines? And if so what way did they go about it .? (5 Replies)
Discussion started by: nano2
5 Replies

6. UNIX and Linux Applications

Looking for memory leaks freeware tools

Hello all Is there good free ware tools to check software memory leaks ? Some thing like purify on unix platforms sun/hp/linux Thanks (3 Replies)
Discussion started by: umen
3 Replies

7. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

8. AIX

valgrind - pthread memory leaks on AIX

Hi all, I have written a small code just to invoke main and return immediately. When built with libpthread on AIX box, valgrind throws lots of memory leak errors. But when built without libpthread, no issues at all. Here is the sample run for your look. Any idea where I might be going wrong?... (3 Replies)
Discussion started by: visionofarun
3 Replies

9. Emergency UNIX and Linux Support

Memory leaks on compilations

Hello! I've been struggling for not few hours with memory leaks on this machine. I'm running linux 2.6.32-5-686, and the problem is as follows: Some months ago, I have compiled kernel 2.6.33-2-686 without any issues in this same machine. This week I have tried compiling GNUzilla Icecat and... (23 Replies)
Discussion started by: teresaejunior
23 Replies

10. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies
WAIT(2) 							System Calls Manual							   WAIT(2)

NAME
wait, waitpid - wait for process to terminate SYNOPSIS
#include <sys/types.h> #include <sys/wait.h> pid_t wait(int *status) pid_t waitpid(pid_t pid, int *status, int options) DESCRIPTION
Wait causes its caller to delay until a signal is received or one of its child processes terminates. If any child has died since the last wait, return is immediate, returning the process id and exit status of one of the terminated children. If there are no children, return is immediate with the value -1 returned. On return from a successful wait call, status is nonzero, and the high byte of status contains the low byte of the argument to exit sup- plied by the child process; the low byte of status contains the termination status of the process. A more precise definition of the status word is given in <sys/wait.h>. If wait can called with a null pointer argument to indicate that no status need be returned. Waitpid provides an alternate interface for programs that must not block when collecting the status of child processes, or that wish to wait for one particular child. The pid parameter is the process ID of the child to wait for, -1 for any child. The status parameter is defined as above. The options parameter is used to indicate the call should not block if there are no processes that wish to report status (WNOHANG), and/or that children of the current process that are stopped due to a SIGTTIN, SIGTTOU, SIGTSTP, or SIGSTOP signal should also have their status reported (WUNTRACED). (Job control is not implemented for Minix, but these symbold and signals are.) When the WNOHANG option is specified and no processes wish to report status, waitpid returns -1 with errno set to EAGAIN. The WNOHANG and WUNTRACED options may be combined by or'ing the two values. NOTES
The call wait(&status) is equivalent to waitpid(-1, &status, 0). See sigaction(2) for a list of termination statuses (signals); 0 status indicates normal termination. A special status (0177) is returned for a stopped process that has not terminated and can be restarted; see ptrace(2). If the 0200 bit of the termination status is set, a core image of the process was produced by the system. If the parent process terminates without waiting on its children, the initialization process (process ID = 1) inherits the children. <sys/wait.h> defines a number of macros that operate on a status word: WIFEXITED(status) True if normal exit. WEXITSTATUS(status) Exit status if the process returned by a normal exit, zero otherwise. WTERMSIG(status) Signal number if the process died by a signal, zero otherwise. WIFSIGNALED(status) True if the process died by a signal. WIFSTOPPED(status) True if the process is stopped. (Never true under Minix.) WSTOPSIG(status) Signal number of the signal that stopped the process. RETURN VALUE
If wait returns due to a stopped or terminated child process, the process ID of the child is returned to the calling process. Otherwise, a value of -1 is returned and errno is set to indicate the error. Waitpid returns -1 if there are no children not previously waited for, if the process that it wants to wait for doesn't exist, or if WNO- HANG is specified and there are no stopped or exited children. ERRORS
Wait will fail and return immediately if one or more of the following are true: [ECHILD] The calling process has no existing unwaited-for child processes. [EFAULT] The status argument points to an illegal address. [EAGAIN] Waitpid is called with the WNOHANG option and no child has exited yet. SEE ALSO
execve(2), exit(2), sigaction(2). 4th Berkeley Distribution June 30, 1985 WAIT(2)
All times are GMT -4. The time now is 07:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy