LinuxQuestions.org
Help answer threads with 0 replies.
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 07-07-2010, 11:17 AM   #1
kappauk
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
Excessive swap file


Hi just a quick question...

We have just been looking at a swap file on one of our Linux boxes and have noticed it's at 23gb which seems pretty big.
I was wondering is there a way we can find out

A: What it's original size was (so we can see how much it's grown)
B: What's in the file at the moment.

Cheers
 
Old 07-07-2010, 12:15 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
I didn't think there was a swap "file" in linux. There is a swap partition but you don't access it from a filesystem. You can run top to see details about it's size and usage, but it is not a dynamically resized item.

Maybe you are looking at something in /tmp ?
 
Old 07-07-2010, 12:53 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,696

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Yes, you can have swap file(s) in addition to partition(s). AFAIK and as already stated they are not dynamic. swap is not mountable nor is it a real filesystem but it maybe possible to examine its contents with utilities like testdisk and photorec. Without reference to hardware and what type of applications you run it is difficult to say how much swap is really required.

BTW tmpfs is dynamic and can shrink and grow as required.
 
Old 07-07-2010, 05:51 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
A: As stated above, it won't have "grown" - that was the size it was initially allocated (file or partition, same applies).
B: "swapon -s" will give you the status of any/all swap extents currently in use.

Unless you are using RHEL, that size is just a waste of disk space, as the system won't use it all (RH have a patch to use bigger).
 
  


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
swap file vs. swap partition verndog Ubuntu 16 07-09-2012 08:49 PM
Can swap file or a swap partition be mounted and read? Mr-Bisquit Linux - General 3 06-08-2009 02:16 PM
Excessive RAM/swap usage Jinouchi Linux - Software 10 03-09-2009 09:59 AM
swap file or swap space? simonb1975uk Linux - General 11 08-15-2008 02:39 PM
Need Help Increasing Swap by creating a swap file froggo Red Hat 3 06-13-2006 08:04 AM

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

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