I have 2G of physical memory and 1G of memory swap. Very rarely the memory swap is used and when usage is around 1% while, then gets a lot of free physical memory...My question is:It is possible to "clean up" the memory swap. Or better still (I think). It is possible to spendphysical memory for data that is in memory swap?
I have a system with 2G of memory and swap memory of 4G.
This is the output from :
PHP Code:
How could they do to the memory cache to be used as much? Because, occasionally, swap is used and note that the system could use the memory cache does not swap ...
RAM for older machines like I use is fairly cheap these days. But flash memory is just as cheap or cheaper. So I'd like to ask about the feasibility of expanding my system's memory using flash memory. And about whether creating a partition for swap on the flash memory, or whether a swap file on the flash device, is the better way to go.
By flash memory I have in mind mainly USB sticks or what are sometimes called "pen drives." But I do also have CF and SD cards that, with the proper cheap adapter (one of which I already own for adapting CF) could be used to create extra swap space. So, what is the current consensus on the feasibility/advisability of using flash memory for swap? I've read about the limited write cycles of flash being an argument against using it for swap. But recent reading indicates to me that the limited write cycles problem applies mostly to older, smaller-capacity flash memory. Some will come out and say that, for larger-capacity flash memory, the life of the device is likely to exceed the amount of time your current computer will be useful (I think I've seen estimates in the range of 3-4 years life--minimum--for newer, higher-capacity flash memory).
A more persuasive argument I've heard against using flash memory for swap is that access times for these devices can be much slower than SATA, and maybe even IDE, hard drives. That would certainly dictate against using flash memory for swap.
So, how about some input on this issue? Anyone using flash memory for swap? If so, what kind (e.g., usb stick or SD/CF)? Are you using a swap file or a swap partition? How's system performance? Likewise, has anyone had flash-memory-used-as-swap die on them? The consequences would undoubtedly be dire. Also, has anyone measured flash memory access times to confirm or refute claims about slow access times? Are some types of flash memory better/worse than others in terms of access times?
Closest analogy I can compare what I want to, is like the `sync` command, which writes out all stuff in the disk buffers, freeing the buffers.Instead of disk buffers, I want to 'clean out' my RAM and SWAP of any/all junk that's accumulated in there over the time my PC has been up. I've long wondered about this, but never asked, though I recall searching around several times..When I first boot it cold and log in, the memory usage bar on my desktop is near zero, and the swap is empty. But after a week or 2 or 3 or more of uptime, and with Firefox always running with a dozen tabs or so at any given time, I end up with all the memory full or 'filled with cached stuff', and the swap space is filled to capacity.Curiousity: I blame Firefox for leaking memory, but even if that's still the case today (historically it was) can this all be blamed on Firefox? Or what-all causes this, besides Firefox- just..Everything?
Here's current stats:
Code:
sasha@reactor: uptime 21:21:42 up 30 days, 10:07, 3 users, load average: 0.02, 0.05, 0.01 sasha@reactor: free total used free shared buffers cached
[code]...
So, 3.8 of 4 Gib of RAM is occupied, and the 1 Gib swap space is jammed full 100%. This must slow things down to some degree, yes? I mean, the kernel does have to keep track of this, right?Of course closing all the applications doesn't make a difference (not an appreciable one anyhow) and the only way I have found to start fresh is to reboot.
I am having a Oracle server installed on Linux server. I want to clear the buffers after a certain time interval. I use the following command for the same.
echo 3 > /proc/sys/vm/drop_caches
Can I have a script which will execute the above script after certain time interval OR a script which will execute the above command when certain memory size is reached.
I've an 8GB swap (I know, overkill, but I don't have space issues, and I'd rather have too much instead of too less). The problem is that my physical memory fills up, and the system crashes, but swap usage is ALWAYS 0% Mem: 8060580k total, 5193436k used, 2867144k free, 1013788k buffers Swap: 8388604k total, 0k used, 8388604k free, 2262112k cached Setting aside the fact that I can't trace why memory usage goes up to 8GB with just firefox/terminals/pidgin, why isn't my swap EVER used?
Also, if I run Code: # top 2301 hugo 20 0 1887m 665m 38m S 19.9 8.5 267:38.63 firefox-bin 1811 root 20 0 166m 67m 10m S 10.8 0.9 128:04.59 X 1973 hugo 20 0 306m 78m 16m S 0.8 1.0 42:30.04 compiz 2024 hugo 20 0 487m 13m 8836 S 0.2 0.2 2:14.73 Terminal 1980 hugo 20 0 333m 7228 5492 S 0.1 0.1 0:54.49 lxpanel 7048 hugo 20 0 15016 1168 820 R 0.1 0.0 0:00.03 top (The rest are all "0 0 0 0 S 0.0 0.0")
If add up all of the RES columns, I get <1GB. If I add all the VIRT column, I get about 3GB. Where's the other 2GB being used? This goes up all the way to 8GB, without being able to add up where my memory's going.
There are plenty of tools for umounting/mounting/automounting usb flash/pen drives/dongles/hard drives. There's the Device Notifier on kde 4, for example.
But what about other devices like headphones, mice, keyboards, modems, etc? A tool for doing this would be very handy.
When we want to setup a linux system, there is a common a suggestion like set the swap space as twice as big than your physical memory, I want to know why do we need this and how is this suggestion come from?
I used Gparted to resize the swap area, and doing so changed the UUID so now the swap memory is not activated automatically and hibernation is also inactive. i got some info about this in a previous thread, which became inactive, and could not fix the problem.the output of sudo blkid is:Quote:
I did a standard install of Ubuntu 9.10, then upgraded to 10.04 LTS. Whenever I run htop I get:CPU [~3.8%] Mem [100/244MB] Swp [87/713MB]And free -mMem- total:244 used:214 free:29Swap- total:713 used:86 free:626It seems like I should be using allocating more memory to swap. I should be using more swap, or if this looks normal B. If so, how do I re allocate more memory to swap?I am new to linux and still trying to figure out a lot of things.
I wonder why swap memory is not used! I also face auto-restart issue while running few tasks. Does it relate to the swap memory?
uanme -r -> 2.6.18-164.el5
I remember that my i have allocated about 5G for swap memory. However I put it into different partition and far away from root partition due to diskspace partition. Does it matter?
I do not know how to show the swap memory partition or partition map over here.
here is the mount output /dev/sda2 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw)
i have a RAM of 1 Gb & swap of 1Gb with fedora11 installed, initially in RAM programme memory uses around 300 Mb & cache uses 600-700 Mb , but after some time it starts using swap memory though my programme memory is still around 300 mb, it keeps on increasing swap memory as a result my system keeps on slowing down & finally when swap memory is 100% system almost stops responding but programme memory is still around 300mb.
I run a memory-hungry process (mkcromfs) which consumes more memory than I have physical memory on my latop, so it is paging and swappin and thrashing all the time and loadavg is about 2 (compcache is already in use with usual swap partition as well), but slowly moving forward (Although I afraid it will finally try to allocate >2GB and crash draining 2 days of thrashing).
When I want to use the laptop for something else, I stop the process, start X server, firefox and other programs. The problem is that when I start Firefox the loadavg jumps to 10 and the system becomes almost unresponsive at all (long time to turn on/off caps lock, slow mouse cursor position updates, slow switching from X server to Linux console, slow login).
The stopped mkcromfs still holds a lot of memory (464.8 MiB and slowly falling) and moves it to swap only when more memory is needed for some other program, which results in a great slowdown.
How to tell the Linux to swap out this process entirely (e.g. I'm not intending to resume it in short term), possibly waking from swap other data? Also it will be useful to be able to specify the exact swap device to swap the given process out (for example, mkcromfs's memory is useless in ramzswap).
Update: Now I just write a 400-600M of data from /dev/erandom to tmpfs and it makes mkcromfs to shrink. Is there more proper way?
Nagios had alerted me that the server had a very high load average exceeding the critical level (17+), when logging onto the server I found that all 4GB of the swap was in use despite the fact that there was 15GB+ of free memory (and that's not even including memory from cache and buffers!) Because it seems all heavily used pages were being stored in swap, the I/O wait on the server became very high, and 4 kswapd daemons were taking up nearly 100% available CPU. This did coincide with an error reported by Bacula during a backup job while changing to a bad tape...
From /var/log/bacula.log: Code: 10-Dec 02:11 bacula-sd JobId 1898: End of medium on Volume "4097" Bytes=434,170,000,000 Blocks=217,084 at 10-Dec-2010 02:11. 10-Dec 02:11 bacula-sd JobId 1898: 3307 Issuing autochanger "unload slot 4097, drive 0" command. 10-Dec 02:12 bacula-sd JobId 1898: 3301 Issuing autochanger "loaded? drive 0" command. 10-Dec 02:12 bacula-sd JobId 1898: 3302 Autochanger "loaded? drive 0", result: nothing loaded. 10-Dec 02:12 bacula-sd JobId 1898: 3304 Issuing autochanger "load slot 4096, drive 0" command. 10-Dec 02:13 bacula-sd JobId 1898: 3305 Autochanger "load slot 4096, drive 0", status is OK. 10-Dec 02:13 bacula-sd JobId 1898: Volume "4096" previously written, moving to end of data. 10-Dec 03:51 bacula-sd JobId 1898: Error: Unable to position to end of data on device "Tape-1" (/dev/IBMtape0n): ERR=dev.c:1384 read e rror on "Tape-1" (/dev/IBMtape0n). ERR=Input/output error.
10-Dec 03:51 bacula-sd JobId 1898: Marking Volume "4096" in Error in Catalog. 10-Dec 03:51 bacula-sd JobId 1898: 3307 Issuing autochanger "unload slot 4096, drive 0" command. 10-Dec 03:58 bacula-sd JobId 1898: 3301 Issuing autochanger "loaded? drive 0" command. 10-Dec 03:58 bacula-sd JobId 1898: 3302 Autochanger "loaded? drive 0", result: nothing loaded. 10-Dec 03:58 bacula-sd JobId 1898: 3304 Issuing autochanger "load slot 4098, drive 0" command. 10-Dec 03:58 bacula-sd JobId 1898: 3305 Autochanger "load slot 4098, drive 0", status is OK. 10-Dec 03:59 bacula-sd JobId 1898: Wrote label to prelabeled Volume "4098" on device "Tape-1" (/dev/IBMtape0n) 10-Dec 03:59 bacula-sd JobId 1898: New volume "4098" mounted on device "Tape-1" (/dev/IBMtape0n) at 10-Dec-2010 03:59. At the same time, these messages starting occuring in /var/log/messages:
Code: Dec 10 03:51:47 07 kernel: Mem-info: Dec 10 03:51:47 07 kernel: Node 0 DMA per-cpu: Dec 10 03:51:47 07 kernel: cpu 0 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 0 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 1 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 1 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 2 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 2 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 3 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 3 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 4 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 4 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 5 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 5 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 6 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 6 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 7 hot: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: cpu 7 cold: high 0, batch 1 used:0 Dec 10 03:51:47 07 kernel: Node 0 DMA32 per-cpu: Dec 10 03:51:47 07 kernel: cpu 0 hot: high 186, batch 31 used:162 Dec 10 03:51:47 07 kernel: cpu 0 cold: high 62, batch 15 used:48 Dec 10 03:51:47 07 kernel: cpu 1 hot: high 186, batch 31 used:0 Dec 10 03:51:47 07 kernel: cpu 1 cold: high 62, batch 15 used:0 Dec 10 03:51:47 07 kernel: cpu 2 hot: high 186, batch 31 used:0 Dec 10 03:51:47 07 kernel: cpu 2 cold: high 62, batch 15 used:0 Dec 10 03:51:47 07 kernel: cpu 3 hot: high 186, batch 31 used:18 Dec 10 03:51:47 07 kernel: cpu 3 cold: high 62, batch 15 used:0 Dec 10 03:51:47 07 kernel: cpu 4 hot: high 186, batch 31 used:159 Dec 10 03:51:47 07 kernel: cpu 4 cold: high 62, batch 15 used:56 ... Dec 10 03:51:47 07 kernel: Node 3 HighMem per-cpu: empty Dec 10 03:51:47 07 kernel: Free pages: 732052kB (0kB HighMem) Dec 10 03:51:47 07 kernel: Active:4232128 inactive:3071288 dirty:158210 writeback:0 unstable:0 free:183320 slab:256840 mapped-file:289545 mapped-anon:3805487 pagetables:13063 Dec 10 03:51:47 07 kernel: Node 0 DMA free:10796kB min:4kB low:4kB high:4kB active:0kB inactive:0kB present:10356kB pages_scanned:0 all_unreclaimable? yes Dec 10 03:51:47 07 kernel: lowmem_reserve[]: 0 3512 9067 9067 Dec 10 03:51:47 07 kernel: Node 0 DMA32 free:213332kB min:2500kB low:3124kB high:3748kB active:1794108kB inactive:1463220kB present:3596296kB pages_scanned:64 all_unreclaimable? no Dec 10 03:51:47 07 kernel: lowmem_reserve[]: 0 0 5555 5555 Dec 10 03:51:47 07 kernel: Node 0 Normal free:41028kB min:3952kB low:4940kB high:5928kB active:3409444kB inactive:1471120kB present:5688320kB pages_scanned:0 all_unreclaimable? no Dec 10 03:51:47 07 kernel: lowmem_reserve[]: 0 0 0 0 Dec 10 03:51:47 07 kernel: Node 0 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no Dec 10 03:51:47 07 kernel: lowmem_reserve[]: 0 0 0 0 Dec 10 03:51:47 07 kernel: Node 1 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no ... Well to cut a long story short, I fixed the problem by disabling the swap partition with 'swapoff'. After about 30 mins all the swap was freed and the server went back to normal. I don't dare reactivate the swap partition and unfortunately as this is a live server which currently has no fail over, I can't reboot either
Server Spec: 4 * Dual-Core AMD Opteron(tm) Processor 8214 32GB DDR2 ECC RAM RHEL 5.5, 2.6.18-194.11.3.el5 SMP x86_64 Running many KVM VMs (All CentOS x64) and kksmd is used. bacula-dir Version: 5.0.0 IBM Tape Drive using lin_tape module version 1.34.0 according to modinfo
And before anybody asks # sysctl vm.swappiness vm.swappiness = 10
In our cluster, both the server and worker had been gone to swap and the performance is extremely slow. Although currently the memory is free but I don't know why the in the swap area is still being there and ubuntu doesn't move them to the memory and empty the swap.
On the other hand, when I run
Code: sudo swapoff -a on the server it says: Code: mahmood@server:~$ sudo swapoff -a
How would I clear my commandline history at logon/logoff/startup time? I tried this : editing my /etc/rc.d/rc.local file like this I know this is for system startup
Code: #!/bin/sh # /etc/rc.d/rc.local: Local system initialization script. # Put any local startup commands in here.
Also, if you have anything that needs to be run at shutdown time you can make an /etc/rc.d/rc.local_shutdown script and put those commands in there.
#clear user history ~/.bash_history echo "" > ~/.bash_history #clear root history /root/.bash_history echo "" > /root/.bash_history
how do you clear the highlighted results after searching in elvis and other text viewer programs such as less?Also I know it's been mentioned before, but why does pat prefer elvis to vim? Just a personal preference?
I am running Slackware 13.0 on an computer with low memory (128 MB, i thought). When I type "free -m" in xterm terminal it displays.In the last line it displays only 5 MB used of 687. Is that normal?
I got two problems. Problem 1 the sound is kind of sketchy..I thought the sound card got blown. But I heard my friend got sound on it again before we put Slackware on. Next I left him to install it while I went to class. I don't think he put a swap in. The computer is painfully slow and it can't even switch users because it looks like the ram got murdered or something. My Questions are how to test / get a working sound card. I did do the alsamixer I think the command is and turn the volume levels up yet I don't hear anything.
As far as the swap partions I don't there is one but I am not sure how to look / check to where if he made it to small or not at all.
I'm using slackware about a month now and two days ago I checked to see the usage of my RAM and I saw that there was no swap, no used, no total, nothing! (how can this be?) swap -s returned nothing, I checked fstab and there was swap there so I entered the line about swap:
I believe it' s correct. I checked after restart with "free" and the total was ok but used is 0. I copied about 5 GB to see what would happen and still nothing. RAM was nearly full but still no swap used!
While this is the second notebook I've had the luxury of running Slackware on, I have never used the the suspend to RAM / swap functions so all of this is new to me. With this new notebook and new installation of Slackware 13.1 I decided to give it a shot as it's definitely a power sucker. The machine is a Lenovo W510 with an NVidia graphics card running KDE. When I tell KDE to go to Sleep (RAM suspension) it looks like it does so properly by blanking the screen and pushing things to RAM. Is there a way to verify that Sleep is working? Anyway after unlocking the system my mouse pointer is no longer visible, however it is still active as I can hover over items to reveal their popups.
At this point none of my conky displays are transparent anymore, nor are they actively displaying stats. The windows I have set to display with 88% opacity are no longer as such and are completely opaque. It is as if all the custom window settings are ignored. If I move the the mouse towards the bottom of the screen the screen starts to go crazy with this rainbow of colors across the top of the screen and the only way to get out of this is to press Ctrl-ESC to bring up a System Activity window. I have not tried Hibernate yet as I would like to get this resolved first. Is Slackware 13.1 supposed to be able to Sleep/Hibernate with no special configuration and creation of scripts provided that the system can handle these functions?
Did a fresh install of 13.1 using lvm for the first time. I created swap in the logical volume but forgot to add it when I ran through the install. Do I need to just add an entry to my fstab and then swapon -va?
Currently running Slackware64 13.1 on a notebook and for the most part everything works fine. Only problem I am running into is with hibernation, where sometimes it will go into hibernation without a hitch and sometimes it will stall after blanking the screen and never turning off. For the most part pm-suspend.log looks fine every time, whether it goes into hibernation or not. My current system has 12GB of RAM and my swap partition is roughly 12GB. For the most part my RAM usage right before going into hibernation is always under 1.5GB with maybe 600MB floating in the swap partition. Could the size of my swap partition be too small even if RAM usage is nowhere near max?