From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 4628 invoked from network); 16 Feb 2000 21:38:58 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 16 Feb 2000 21:38:58 -0000 Received: from hyp02.larc.nasa.gov (hyp02.larc.nasa.gov [128.155.28.39]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id QAA02978 for ; Wed, 16 Feb 2000 16:38:58 -0500 Received: from hyp72.larc.nasa.gov by hyp02.larc.nasa.gov with ESMTP (8.8.5/server2.4) id QAA05321; Wed, 16 Feb 2000 16:38:33 -0500 (EST) Received: from larc.nasa.gov (localhost [127.0.0.1]) by hyp72.larc.nasa.gov (980427.SGI.8.8.8/980728.SGI.AUTOCF) via ESMTP id QAA48622 for ; Wed, 16 Feb 2000 16:38:31 -0500 (EST) Sender: jawhite@larc.nasa.gov Message-ID: <38AB18D7.CBAA422F@larc.nasa.gov> Date: Wed, 16 Feb 2000 16:38:31 -0500 From: "Jeffery A. White" Organization: NASA LaRC, Hypersonic Airbreathing Propulsion Branch X-Mailer: Mozilla 4.51C-SGI [en] (X11; I; IRIX64 6.5 IP30) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Memory leaks References: Content-Type: multipart/mixed; boundary="------------C5C60B5DB40602A46C7532DA" This is a multi-part message in MIME format. --------------C5C60B5DB40602A46C7532DA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Phillip Ezolt wrote: > > Jeff, > Linux looks things a little differently than MSDOS/Windows does. > > In an ideal Linux system, you want to have NO free memory. Linux uses > all extra memory as a disk cache. When user programs request memory, > it will give up some of some the disk cache so that they can use it. > > Your application probably does about 500MB of disk I/O. Linux keeps this > in its buffers. (You have 250MB in buffers, & 300MB in the page cache) > > No free memory is a GOOD thing. Linux will give up buffers when > programs need it. When they don't Linux will use the memory to make > the system faster. > > --Phil > > Compaq: High Performance Server Division/Benchmark Performance Engineering > ---------------- Alpha, The Fastest Processor on Earth -------------------- > Phillip.Ezolt@compaq.com |C|O|M|P|A|Q| ezolt@perf.zko.dec.com > ------------------- See the results at www.spec.org ----------------------- > > On Wed, 16 Feb 2000, Jeffery A. White wrote: > > > Brian Pomerantz wrote: > > > > > > On Wed, Feb 16, 2000 at 03:13:12PM -0500, Jeffery A. White wrote: > > > > > > > > Here are the results from free > > > > > > > > Rebooted the node and typing free gives : > > > > > > > > total used free shared buffers cached > > > > Mem: 1035416 32504 1002912 15112 3296 16104 > > > > -/+ buffers/cache: 13104 1022312 > > > > Swap: 2094560 0 2094560 > > > > > > > > After job completion free gives: > > > > > > > > total used free shared buffers cached > > > > Mem: 1035416 595392 440024 15112 244536 298736 > > > > -/+ buffers/cache: 52120 983296 > > > > Swap: 2094560 0 2094560 > > > > > > > > > > If you look at the second line from free on both runs, the first > > > number is the amount of memory actually being used by kernel/programs > > > (minus buffer and cache) and the second number is the amount of > > > "free" memory that can be reclaimed if need be. If you run your > > > program a few more times and look at this second line, it should be > > > about the same on the last two runs. There will probably be some swap > > > used after a while but it should stabilize and not try to claim more. > > > If you run your program several times and swap continues to grow, then > > > you have a problem. There is a way to poke the proc file system to > > > tell the kernel max buffer and cache usage which could minimize swap > > > usage a little more, but I don't recall how to do this off the top of > > > my head. The tradeoff there is you'll still have around the same > > > amount of disk I/O if you are writing a lot to disk and using swap is > > > probably faster than writing dirty pages to disk. I would say from > > > these results you probably don't have a memory leak, but you should > > > run your program a few more times to watch the behavior of your swap > > > usage. > > > > > > BAPper > > > > > > > I am a little confused by what you have said above > > The first number (under the total column) would appear to me > > to be constant and be the total memory on the machine. > > The second number (under the used column) I though was the > > memory currently in use. > > The third number (under the free column) I thought was the > > memory currently availble. > > > > I guess I don't uderstand what swap means in this context. I > > thought if swap "used" becomes non-zero that I am reading and > > writting to disk to make up for the memory I don't have which would be > > death to my throughput, not to mention my floating point. > > > > I tried you suggestion about multiple jobs in succesion and I > > get from free after the first job ends > > > > total used free shared buffers > > cached > > Mem: 1035416 609352 426064 15128 254800 > > 300840 > > -/+ buffers/cache: 53712 981704 > > Swap: 2094560 0 2094560 > > > > While the second job runs I get > > > > total used free shared buffers > > cached > > Mem: 1035416 811648 223768 18584 254800 > > 301768 > > -/+ buffers/cache: 255080 780336 > > Swap: 2094560 0 2094560 > > > > After the second job ends I get > > > > total used free shared buffers > > cached > > Mem: 1035416 609568 425848 15128 254920 > > 300840 > > -/+ buffers/cache: 53808 981608 > > Swap: 2094560 0 2094560 > > > > While the third job runs I get > > > > total used free shared buffers > > cached > > Mem: 1035416 841784 193632 18872 254920 > > 302016 > > -/+ buffers/cache: 284848 750568 > > Swap: 2094560 0 2094560 > > > > > > After the third job ends I get > > total used free shared buffers > > cached > > Mem: 1035416 609520 425896 15128 254920 > > 300840 > > -/+ buffers/cache: 53760 981656 > > Swap: 2094560 0 2094560 > > > > I guess what I don't uderstand is why the free does not every > > go back up to near the total number when the job completes its > > execution. > > > > Jeffery A. White > > email : j.a.white@larc.nasa.gov > > Phone : (757) 864-6882 ; Fax : (757) 864-6243 > > URL : http://hapb-www.larc.nasa.gov/~jawhite/ > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com Phil, Sorry I guess I spent too many years on Crays and am a bit late to these types of machines and am a bit paranoid about memory useage. Thanks for clearing this up! -- Jeffery A. White email : j.a.white@larc.nasa.gov Phone : (757) 864-6882 ; Fax : (757) 864-6243 URL : http://hapb-www.larc.nasa.gov/~jawhite/ --------------C5C60B5DB40602A46C7532DA Content-Type: text/x-vcard; charset=us-ascii; name="j.a.white.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Jeffery A. White Content-Disposition: attachment; filename="j.a.white.vcf" begin:vcard n:White;Jeff tel;fax:(757) 864 - 6243 tel;work:(757) 864 - 6882 x-mozilla-html:FALSE url:hapb-www.larc.nasa.gov/~jawhite org:NASA Langley Research Center ;Hypersonic Airbreathing Propulsion Branch version:2.1 email;internet:j.a.white@larc.nasa.gov title:Aerospace Engineer adr;quoted-printable:;;Mail Stop 168=0D=0A;Hampton;Virginia;23681-2199;USA x-mozilla-cpt:;-2272 fn:Jeffery A. White end:vcard --------------C5C60B5DB40602A46C7532DA--