Sponsored Content
Full Discussion: OOM KIller INVOKE
Top Forums UNIX for Advanced & Expert Users OOM KIller INVOKE Post 302346815 by subratasaharia on Monday 24th of August 2009 06:46:44 AM
Old 08-24-2009
OOM KIller INVOKE

Hi
I have written a code that will exhaust the memory completely by allocating it and not freeing it. The OOM killer as expected in invoked and it killed a few high memory using processes and their childs.
But after that, though the system is not getting hung, it is not printing any msgs in console neither it is responding to ping or telnet.
What is the expected behaviour after an OOM kill. ? Please comment on why the node went into an virtual hung state after OOM kill.

---------- Post updated at 05:46 AM ---------- Previous update was at 05:42 AM ----------

This is the console prints:
=================================================================
available memory stated is 487MB
And malloc'd memory is 0MB
Enter percentage memory to be alloc'd (0 to quit) : 100
available memory stated is 487MB
And malloc'd memory is 487MB
malloc invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
Call Trace:
[9e913d20] [80006844] show_stack+0x3c/0x1bc (unreliable)
[9e913d60] [80056a14] oom_kill_process+0x114/0x1bc
[9e913d90] [80056e60] out_of_memory+0x1ac/0x1e8
[9e913dd0] [800598f0] __alloc_pages_internal+0x40c/0x440
[9e913e50] [8006424c] handle_mm_fault+0x26c/0x470
[9e913e80] [801ccb58] do_page_fault+0x314/0x510
[9e913f40] [8000d834] handle_page_fault+0xc/0x80
Mem-info:
DMA per-cpu:
CPU 0: hi: 186, btch: 31 usd: 175
Active:123608 inactive:31 dirty:0 writeback:0 unstable:0
free:689 slab:1244 mapped:1259 pagetables:311 bounce:0
DMA free:2756kB min:2860kB low:3572kB high:4288kB active:494432kB inactive:124kB present:512064kB pages_scanned:772531 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0
DMA: 1*4kB 0*8kB 0*16kB 0*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 2756kB
1292 total pagecache pages
129024 pages of RAM
1730 reserved pages
7284 pages shared
0 pages swap cached
Out of memory: kill process 2021 (tn_init.d) score 162152 or a child
Killed process 2023 (nm.d)
malloc invoked oom-killer: gfp_mask=0x1200d2, order=0, oomkilladj=0
Call Trace:
[9e913d20] [80006844] show_stack+0x3c/0x1bc (unreliable)
[9e913d60] [80056a14] oom_kill_process+0x114/0x1bc
[9e913d90] [80056e60] out_of_memory+0x1ac/0x1e8
[9e913dd0] [800598f0] __alloc_pages_internal+0x40c/0x440
[9e913e50] [8006424c] handle_mm_fault+0x26c/0x470
[9e913e80] [801ccb58] do_page_fault+0x314/0x510
[9e913f40] [8000d834] handle_page_fault+0xc/0x80
Mem-info:
DMA per-cpu:
CPU 0: hi: 186, btch: 31 usd: 176
Active:123603 inactive:36 dirty:0 writeback:0 unstable:0
free:783 slab:1240 mapped:1259 pagetables:311 bounce:0
DMA free:3132kB min:2860kB low:3572kB high:4288kB active:494412kB inactive:144kB present:512064kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 1*4kB 3*8kB 4*16kB 5*32kB 3*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 1*2048kB 0*4096kB = 3132kB
1292 total pagecache pages
129024 pages of RAM
1730 reserved pages
7284 pages shared
0 pages swap cached
Out of memory: kill process 2039 (nm.d) score 13684 or a child
Killed process 2039 (nm.d)














^C^C^C^C^C^C^C^Cc


================================================================
As seen its not responding to ^C . But on pressing enter , response is there.
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

invoke same script twice

hey, can I invoke the same script twice simultaneously? I want both instances to run at the same time with different parameters. Thanks! (2 Replies)
Discussion started by: mpang_
2 Replies

2. Shell Programming and Scripting

help rsh killer

hi everyone , i have a rsh problem , some of the users letf a lot of rsh sesions opened , i need a script that chek with a "ps -fea | grep rsh" and kill every sesion that not start today . for example root 26770 26767 0 Apr 17 ? 0:00 rsh c-108 find / -type d -mtime +1 -name... (3 Replies)
Discussion started by: gonzo
3 Replies

3. UNIX for Dummies Questions & Answers

How to invoke ESC+K

How to invoke ESC+K to get recent commands in Korn Shell. In some of the unix machine ESC+K is available and in some machines, it does not work. All of the machines that I work have Korn shell. (5 Replies)
Discussion started by: bobbygsk
5 Replies

4. Shell Programming and Scripting

invoke fork command

Hi, I have startup shell script called "xxxxx" for Jboss server which is taking more than expected timeline to complete the process, here I want to use the fork command to start the child process for non dependent component I have a scheduler called "yyyy" which is currently getting invoked... (2 Replies)
Discussion started by: harish76
2 Replies

5. UNIX for Advanced & Expert Users

How to invoke an URL

Hi, I am trying to invoke an service using URL. I want to know how to call that url with nohup. nohup links "__http://Administrator:assword@ServName:8080/invoke/wm.server.admin/shutdown?bounce=no&option=force&timeout=0" & I am trying to run this command on unix command prompt, But in... (8 Replies)
Discussion started by: swap27
8 Replies

6. Shell Programming and Scripting

Invoke Procedure Help

Hello unix.com users, I reached a dead end with a procedure. My files: x.pl #!/usr/bin/perl use Net::FTP; my $host = $ARGV; my $user = $ARGV; my $pass = $ARGV || ""; my $port = "21"; $ftp=Net::FTP->new("$host", Port=>"$port", Timeout => 5) or die("couldn't connect to host:" .... (2 Replies)
Discussion started by: galford
2 Replies
MALLOC(3)						     Linux Programmer's Manual							 MALLOC(3)

NAME
malloc, free, calloc, realloc - allocate and free dynamic memory SYNOPSIS
#include <stdlib.h> void *malloc(size_t size); void free(void *ptr); void *calloc(size_t nmemb, size_t size); void *realloc(void *ptr, size_t size); DESCRIPTION
The malloc() function allocates size bytes and returns a pointer to the allocated memory. The memory is not initialized. If size is 0, then malloc() returns either NULL, or a unique pointer value that can later be successfully passed to free(). The free() function frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behavior occurs. If ptr is NULL, no operation is per- formed. The calloc() function allocates memory for an array of nmemb elements of size bytes each and returns a pointer to the allocated memory. The memory is set to zero. If nmemb or size is 0, then calloc() returns either NULL, or a unique pointer value that can later be success- fully passed to free(). The realloc() function changes the size of the memory block pointed to by ptr to size bytes. The contents will be unchanged in the range from the start of the region up to the minimum of the old and new sizes. If the new size is larger than the old size, the added memory will not be initialized. If ptr is NULL, then the call is equivalent to malloc(size), for all values of size; if size is equal to zero, and ptr is not NULL, then the call is equivalent to free(ptr). Unless ptr is NULL, it must have been returned by an earlier call to mal- loc(), calloc() or realloc(). If the area pointed to was moved, a free(ptr) is done. RETURN VALUE
The malloc() and calloc() functions return a pointer to the allocated memory that is suitably aligned for any kind of variable. On error, these functions return NULL. NULL may also be returned by a successful call to malloc() with a size of zero, or by a successful call to calloc() with nmemb or size equal to zero. The free() function returns no value. The realloc() function returns a pointer to the newly allocated memory, which is suitably aligned for any kind of variable and may be dif- ferent from ptr, or NULL if the request fails. If size was equal to 0, either NULL or a pointer suitable to be passed to free() is returned. If realloc() fails the original block is left untouched; it is not freed or moved. CONFORMING TO
C89, C99. NOTES
By default, Linux follows an optimistic memory allocation strategy. This means that when malloc() returns non-NULL there is no guarantee that the memory really is available. In case it turns out that the system is out of memory, one or more processes will be killed by the OOM killer. For more information, see the description of /proc/sys/vm/overcommit_memory and /proc/sys/vm/oom_adj in proc(5), and the Linux kernel source file Documentation/vm/overcommit-accounting. Normally, malloc() allocates memory from the heap, and adjusts the size of the heap as required, using sbrk(2). When allocating blocks of memory larger than MMAP_THRESHOLD bytes, the glibc malloc() implementation allocates the memory as a private anonymous mapping using mmap(2). MMAP_THRESHOLD is 128 kB by default, but is adjustable using mallopt(3). Allocations performed using mmap(2) are unaffected by the RLIMIT_DATA resource limit (see getrlimit(2)). To avoid corruption in multithreaded applications, mutexes are used internally to protect the memory-management data structures employed by these functions. In a multithreaded application in which threads simultaneously allocate and free memory, there could be contention for these mutexes. To scalably handle memory allocation in multithreaded applications, glibc creates additional memory allocation arenas if mutex contention is detected. Each arena is a large region of memory that is internally allocated by the system (using brk(2) or mmap(2)), and managed with its own mutexes. The UNIX 98 standard requires malloc(), calloc(), and realloc() to set errno to ENOMEM upon failure. Glibc assumes that this is done (and the glibc versions of these routines do this); if you use a private malloc implementation that does not set errno, then certain library routines may fail without having a reason in errno. Crashes in malloc(), calloc(), realloc(), or free() are almost always related to heap corruption, such as overflowing an allocated chunk or freeing the same pointer twice. Recent versions of Linux libc (later than 5.4.23) and glibc (2.x) include a malloc() implementation which is tunable via environment vari- ables. For details, see mallopt(3). SEE ALSO
brk(2), mmap(2), alloca(3), malloc_get_state(3), malloc_info(3), malloc_trim(3), malloc_usable_size(3), mallopt(3), mcheck(3), mtrace(3), posix_memalign(3) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
2012-05-10 MALLOC(3)
All times are GMT -4. The time now is 12:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy