Unix Technical Forum

how to clean memory storage?

This is a discussion on how to clean memory storage? within the AIX Operating System forums, part of the Unix Operating Systems category; --> I took a test on my AIX 5.3 steps list as below: 1) before testing $ svmon -G free ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 12:51 PM
roger@star2000.com.tw
 
Posts: n/a
Default how to clean memory storage?

I took a test on my AIX 5.3
steps list as below:
1) before testing
$ svmon -G
free size : 92366
2) create a big file
$ cd /u/myap
$ find . -print |cpio -ocduvm > /u/myap.cpi
( myap.cpi about 500 MB)
check size after creating big file
$ svmon -G
free size: 1027
3) rm big file
$ rm myap.cpi
$ svmon -G
free size: 51926

My question is :
How can I run a program that will not keep memory after exit?
It bothered me on my product site , ate my RAM storage,
made page out and in , degrade DB performance .

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 12:51 PM
Christopher Petersen
 
Posts: n/a
Default Re: how to clean memory storage?

On Wed, 18 Jul 2007 16:10:27 -0700, roger wrote:

> I took a test on my AIX 5.3
> steps list as below:
> 1) before testing
> $ svmon -G
> free size : 92366
> 2) create a big file
> $ cd /u/myap
> $ find . -print |cpio -ocduvm > /u/myap.cpi
> ( myap.cpi about 500 MB)
> check size after creating big file
> $ svmon -G
> free size: 1027
> 3) rm big file
> $ rm myap.cpi
> $ svmon -G
> free size: 51926
>
> My question is :
> How can I run a program that will not keep memory after exit? It bothered
> me on my product site , ate my RAM storage,
> made page out and in , degrade DB performance .


That really depends a lot on what you want to do with the file, and more
importantly, the other files in the file system. You can mount a JFS2
file system with the DIO or CIO option to turn off file system buffer
caches, but they have significant side-effects on your program's design
and performance and how you can use the file system in general... They
are really designed for file systems holding Oracle or DB2 (or other)
database files...

-Chris
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 12:51 PM
Borys
 
Posts: n/a
Default Re: how to clean memory storage?

First the answer to your question:
Memory allocated by your programm will be released as soon as it
exited.
Now the rest: Files which were accessed by your programm may be kept
in memory for a while. If you really want to avoid caching use sync io
read and writes in you programm. Setting flag O_SYNC will do the
trick. But forget about performance :-) Mounting filesystem with dio
or sio will do the same but for all you programms.
If you want to get memory back avfter your expirement, do sync,
allocate non-swappable memory space, e.g. mkramdisk, run something
which will use all the rest of real memory plus something in swap and
then exits. and afterwards delete previosly created ram disk. And yes,
sync at the end :-) I'm sure you will get you memory back :-)

On 19 , 01:10, ro...@star2000.com.tw wrote:
> I took a test on my AIX 5.3
> steps list as below:
> 1) before testing
> $ svmon -G
> free size : 92366
> 2) create a big file
> $ cd /u/myap
> $ find . -print |cpio -ocduvm > /u/myap.cpi
> ( myap.cpi about 500 MB)
> check size after creating big file
> $ svmon -G
> free size: 1027
> 3) rm big file
> $ rm myap.cpi
> $ svmon -G
> free size: 51926
>
> My question is :
> How can I run a program that will not keep memory after exit?
> It bothered me on my product site , ate my RAM storage,
> made page out and in , degrade DB performance .



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:02 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com