LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-23-2006, 05:02 PM   #1
yozhhh
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.1
Posts: 26

Rep: Reputation: 15
Purge caches in memory before suspending


I'm using linux on my laptop having 1Gb memory. Each time i start "suspend to disk" the kernel stores the actual memory contents to swap partition. I discovered today that the caches in memory are also written to the swap!

Currently, the memory usage is:
Code:
# free -m
             total       used       free     shared    buffers     cached
Mem:          1010        488        522          0         17        348
-/+ buffers/cache:        123        887
Swap:         1535          0       1535
The caches use 348 Mb of memory. Each time i suspend my laptop this content is written to disk and then read from disk into memory when i switch my laptop on (?). It takes very much time and i don't need it, definitely!

Is there a way to clean the caches before starting suspend?
 
Old 12-01-2006, 02:48 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
This is a wild guess: try "sync" and compare the "free -m" results. Just maybeee...
 
Old 12-01-2006, 09:18 AM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by JZL240I-U
This is a wild guess: try "sync" and compare the "free -m" results. Just maybeee...
I think "sync" just flushes stuff to the disk but doesn't alter memory allocated to cache or buffer (but it never hurts to try.)

I was monitoring this thread to see if anybody came up with something. The kernel is just following the philosophy of "unused memory is wasted memory." Perhaps the issue should be thought of as being with the suspend routines. That either they shouldn't save cache and buffer to disk, or this should be an option. Maybe it is already that way. If not, maybe it should be proposed on the KML.
 
Old 12-01-2006, 09:34 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Well it is a wild guess. As I'm not in front of a linux system perhaps one could try "man *mem*" or "man *buff*"
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Chapter 7: Static Meets Dynamic Adding Caches to Reduce Costs LXer Syndicated Linux News 0 08-16-2006 01:54 PM
Does rebooting and reseting my router and DSL modem clear caches? M$ISBS Linux - Security 5 07-26-2006 05:23 PM
Update others arp caches rickthemick Linux - Networking 2 12-14-2004 06:47 AM
sendmail purge ! freelinuxcpp Linux - Networking 2 11-04-2003 03:11 AM
Purge Printer DelMerkin Linux - General 0 06-01-2003 11:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:04 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