LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2009, 04:43 PM   #16
NeddySeagoon
Gentoo support team
 
Registered: May 2009
Location: 56N 3W
Distribution: Gentoo
Posts: 178

Rep: Reputation: 41

rabbit00,

Quote:
The swap space did not function ( usage stay 0% ) when physical memory (RAM) is full. This cause the workstation hang.
When you run out of memory, the Out of Memory Manager kicks in. It does not cause hangs.
Rather the kernel kills active processes to get RAM for itself. You tend to notice this in action.

Also
Code:
total used free shared buffers cached
Mem: 4095376 4011452 83924 0 48808 2469584
shows your RAM is not full.
The buffers and cached amounts can be freed immediately but the kernel would rather keep data there that has been read/written from disk recently, in case its needed again.

Last edited by NeddySeagoon; 06-23-2009 at 04:47 PM.
 
Old 06-23-2009, 07:02 PM   #17
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Pending an answer from someone who actually knows, try
Code:
cat /proc/slabinfo > file1
right after starting your test program and again (to a different filename) after it has run for a while, preferably more than half way to the failure.

Then diff the two files and find the lines where the second number went up by a lot.

Those may represent the kernel resources that your test program is causing to leak, thus causing the ultimate hang.
Post those line and maybe someone will figure out what kind of bug your program has.
 
Old 07-02-2009, 11:45 PM   #18
rabbit00
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Dear all,

Have try out again with same workstation, program, setting...
Found the swap space is just simply function ( swap space is function although the physical RAM usage is not fulled ).

Still not sure what is the reason.

Anyways, Thanks a lot for your guys advise and help...


--------- meminfo ----------
total: used: free: shared: buffers: cached:
Mem: 4193665024 3646271488 547393536 0 14684160 1616732160
Swap: 4194840576 37519360 4157321216
MemTotal: 4095376 kB
MemFree: 534564 kB
MemShared: 0 kB
Buffers: 14340 kB
Cached: 1576500 kB
SwapCached: 2340 kB
Active: 2245752 kB
ActiveAnon: 1986272 kB
ActiveCache: 259480 kB
Inact_dirty: 998048 kB
Inact_laundry: 144668 kB
Inact_clean: 8 kB
Inact_target: 677692 kB
HighTotal: 3276568 kB
HighFree: 247700 kB
LowTotal: 818808 kB
LowFree: 286864 kB
SwapTotal: 4096524 kB
SwapFree: 4059884 kB
CommitLimit: 6144212 kB
Committed_AS: 5452660 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB

--------- slabinfo ----------
slabinfo - version: 1.1 (SMP)
kmem_cache 80 80 244 5 5 1 : 1008 252
nv_pte_t 1171 1400 16 6 7 1 : 1008 252
nfs_write_data 320 320 384 32 32 1 : 496 124
nfs_read_data 248 510 384 25 51 1 : 496 124
nfs_page 948 1200 128 33 40 1 : 1008 252
ip_fib_hash 14 112 32 1 1 1 : 1008 252
urb_priv 290 290 64 5 5 1 : 1008 252
ext3_xattr 0 0 44 0 0 1 : 1008 252
journal_head 1022 50666 48 22 658 1 : 1008 252
revoke_table 3 250 12 1 1 1 : 1008 252
revoke_record 672 672 32 6 6 1 : 1008 252
clip_arp_cache 0 0 256 0 0 1 : 1008 252
ip_mrt_cache 0 0 128 0 0 1 : 1008 252
tcp_tw_bucket 600 600 128 20 20 1 : 1008 252
tcp_bind_bucket 961 1008 32 9 9 1 : 1008 252
tcp_open_request 210 210 128 7 7 1 : 1008 252
inet_peer_cache 1 116 64 1 2 1 : 1008 252
secpath_cache 0 0 128 0 0 1 : 1008 252
xfrm_dst_cache 0 0 256 0 0 1 : 1008 252
ip_dst_cache 135 135 256 9 9 1 : 1008 252
arp_cache 7 45 256 3 3 1 : 1008 252
flow_cache 0 0 128 0 0 1 : 1008 252
blkdev_requests 5120 5130 128 171 171 1 : 1008 252
kioctx 0 0 128 0 0 1 : 1008 252
kiocb 0 0 128 0 0 1 : 1008 252
dnotify_cache 0 0 20 0 0 1 : 1008 252
file_lock_cache 200 200 96 5 5 1 : 1008 252
async_poll_table 0 0 140 0 0 1 : 1008 252
fasync_cache 254 400 16 2 2 1 : 1008 252
uid_cache 9 224 32 2 2 1 : 1008 252
skbuff_head_cache 1680 1932 168 84 84 1 : 1008 252
sock 908 908 1408 454 454 1 : 240 60
sigqueue 1015 1015 132 35 35 1 : 1008 252
kiobuf 0 0 128 0 0 1 : 1008 252
cdev_cache 464 464 64 8 8 1 : 1008 252
bdev_cache 6 116 64 1 2 1 : 1008 252
mnt_cache 19 58 64 1 1 1 : 1008 252
inode_cache 28787 43183 512 6141 6169 1 : 496 124
dentry_cache 22102 25110 128 837 837 1 : 1008 252
dquot 0 0 128 0 0 1 : 1008 252
filp 6090 6090 128 203 203 1 : 1008 252
names_cache 77 77 4096 77 77 1 : 240 60
buffer_head 262780 282940 108 7963 8084 1 : 1008 252
mm_struct 360 360 384 36 36 1 : 496 124
vm_area_struct 17511 18368 68 320 328 1 : 1008 252
fs_cache 464 464 64 8 8 1 : 1008 252
files_cache 357 357 512 51 51 1 : 496 124
signal_cache 522 522 64 9 9 1 : 1008 252
sighand_cache 329 404 1408 165 202 1 : 240 60
pte_chain 52215 333300 128 2312 11110 1 : 1008 252
pae_pgd 464 464 64 8 8 1 : 1008 252
size-131072(DMA) 0 0 131072 0 0 32 : 0 0
size-131072 0 0 131072 0 0 32 : 0 0
size-65536(DMA) 0 0 65536 0 0 16 : 0 0
size-65536 1 1 65536 1 1 16 : 0 0
size-32768(DMA) 0 0 32768 0 0 8 : 0 0
size-32768 11 11 32768 11 11 8 : 0 0
size-16384(DMA) 0 0 16384 0 0 4 : 0 0
size-16384 22 28 16384 22 28 4 : 0 0
size-8192(DMA) 0 0 8192 0 0 2 : 0 0
size-8192 22 36 8192 22 36 2 : 0 0
size-4096(DMA) 0 0 4096 0 0 1 : 240 60
size-4096 489 489 4096 489 489 1 : 240 60
size-2048(DMA) 0 0 2048 0 0 1 : 240 60
size-2048 684 1044 2048 342 522 1 : 240 60
size-1024(DMA) 0 0 1024 0 0 1 : 496 124
size-1024 632 632 1024 158 158 1 : 496 124
size-512(DMA) 0 0 512 0 0 1 : 496 124
size-512 736 736 512 92 92 1 : 496 124
size-256(DMA) 0 0 256 0 0 1 : 1008 252
size-256 1188 1440 256 93 96 1 : 1008 252
size-128(DMA) 4 30 128 1 1 1 : 1008 252
size-128 3050 3510 128 116 117 1 : 1008 252
size-64(DMA) 0 0 128 0 0 1 : 1008 252
size-64 3761 4170 128 126 139 1 : 1008 252
size-32(DMA) 70 116 64 2 2 1 : 1008 252
size-32 2115 8874 64 68 153 1 : 1008 252


--------- free ----------
total used free shared buffers cached
Mem: 4095376 3560912 534464 0 14340 1576508
-/+ buffers/cache: 1970064 2125312
Swap: 4096524 36640 4059884
 
Old 07-03-2009, 07:55 AM   #19
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by rabbit00 View Post
CommitLimit: 6144212 kB
Committed_AS: 5452660 kB
That suggests another possible problem.

Try
Code:
sysctl vm.overcommit_memory
That displays a value 0, 1 or 2 for the behavior of your system when memory is over committed.
Note sysctl is normally in /sbin so if you aren't root it likely won't be in your path. But it can run (read only) as non root. If the earlier command is not found try
Code:
/sbin/sysctl  vm.overcommit_memory
If the value is 2, that may explain your problem.

Many programs reserve large amounts of anonymous memory that they aren't using and probably never will use. The Committed_AS statistic is the total of all that reserved memory whether currently in use or not. As you can see, on your system the amount reserved is about 3.5GB bigger than the amount used.

If vm.overcommit_memory is set to 2, then the kernel requires unused swap space to cover all of the reserved but unused anonymous memory. You have only a little over 3.5GB of unused swap space, so if processes reserve a little more anonymous memory the system would stop permitting them to reserve any beyond that. That could be the hang you're seeing.

Normally vm.overcommit_memory is set to 0, meaning the system requires unused swap space that is only a fraction of the reserved but unused anonymous memory. That makes sense because programs tend to reserve a lot of anonymous memory they won't actually use.

If the current setting is 2, you could set vm.overcommit_memory to 0 to get the ordinary behavior, or you could even set it to 1, which tells it to never refuse to reserve memory. Then you would get failures from too little memory only when all the memory is actually used, not when it is just reserved.

But since disk space is cheap, you might prefer to just increase the size of the swap space. Even though that swap space wouldn't actually get used, its existence allows Linux to reserve more anonymous memory.

To change vm.overcommit_memory, you must be root
Code:
sysctl vm.overcommit_memory=0

Last edited by johnsfine; 07-03-2009 at 07:57 AM.
 
Old 07-06-2009, 09:18 PM   #20
rabbit00
LQ Newbie
 
Registered: Mar 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
/sbin/sysctl vm.overcommit_memory
The return value = 0.

Currently workstation no hang anymore.
Thanks a lot for your guys advise and help...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Top shows virtual memory use by proccess more than physical RAM! help! aznblood Linux - Software 2 08-21-2008 09:19 AM
my physical memory just get full hua Slackware 15 06-28-2007 03:50 PM
how to use swap more than the physical memory Santosh_d Linux - General 9 03-24-2004 02:51 PM
swap drive, physical memory glock19 Linux - General 6 03-08-2002 04:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration