LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 06-21-2018, 04:22 PM   #1
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Posts: 13

Rep: Reputation: Disabled
How to load swap space in RHEL 6?


Hi,

I have 4GB swap on my Linux machine which is never used as Memory usage was never under heavy usage.

I know how to stress CPU & memory by using "stress" command but how to load swap space so that I can see its usage using "free -m" command? I would like to prefer to load swap space without actually loading memory, if that's possible.

Please advise, many thanks!
 
Old 06-21-2018, 06:16 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 678
Blog Entries: 3

Rep: Reputation: 204Reputation: 204Reputation: 204
Enable all swap devices:
Code:
swapon -a
Enable one swap device:
Code:
swapon /dev/sda3
(for example)
 
Old 06-21-2018, 06:35 PM   #3
nirvaanr
LQ Newbie
 
Registered: Jun 2016
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks coralfang for the reply but you don't seem to understand my question.

My requirement is to "stress" the swap space (not to mount/enable it). In other words, I need to keep "load" (stress) on swap space so that I can see its usage in swap usage statistics. I know that IF i use (stress) more than the RAM size then it might result in swap usage but I prefer not to do that way.

regards,


Quote:
Originally Posted by coralfang View Post
Enable all swap devices:
Code:
swapon -a
Enable one swap device:
Code:
swapon /dev/sda3
(for example)
 
Old 06-21-2018, 06:48 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 18,248

Rep: Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726Reputation: 2726
4G is pretty small but it's rare that it has not been used. How are you deciding that it isn't in use?

Commands like..

top

swap

To verify what you have.

Then change swappiness setting.
 
Old 06-21-2018, 08:30 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 13,698
Blog Entries: 22

Rep: Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601Reputation: 3601
You need to use CPU cycles.

A web search for "stress test RHEL memory" turns up a number of links.

On my own, I thought of playing multiple multimedia files on loop, but I've never done that myself. Running top or htop in a terminal as you run the tests would be a good way of monitoring things.

Last edited by frankbell; 06-21-2018 at 08:31 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Extend Swap Space using Swap file in Linux LXer Syndicated Linux News 0 06-18-2015 01:20 PM
LXer: ADD Swap Space on Linux Servers (CentOS / RHEL / Fedora / Ubuntu) On the Fly LXer Syndicated Linux News 0 05-27-2013 12:40 AM
RHEL AS4 hangs on (enabling swap space) after installing openmpi ferminselvin Linux - Desktop 0 07-30-2008 05:15 AM
how much swap space is needed; how to increase swap space? johnpaulodonnell Linux - Newbie 5 03-23-2007 03:20 AM
Can't reboot RHEL WS4 - swap space issue? genemob Red Hat 3 01-31-2007 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 09:49 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration