In computing, memory refers to the state information of a computing system, as it is kept active in some physical structure.

learn more… | top users | synonyms

70
votes
12answers
27k views

How to fill 90% of the free memory?

I want to do some low-resources testing and for that I need to have 90% of the free memory full. How can I do this on a *nix system?
58
votes
3answers
30k views

How do I read from /proc/$pid/mem under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me $ cat /proc/$$/mem ...
51
votes
9answers
9k views

Why can't Vim open a 100 MB text file when I have 16 GB RAM?

I have a 100MB MySQL database backup file and I have trouble to open it in Vim on my Linux box that has 16G of RAM. Vim just hangs (at least unusable). This is something I don't understand. I have 16 ...
51
votes
5answers
22k views

What are high memory and low memory on Linux?

I'm interested in the difference between Highmem and Lowmem: Why is there such a differentiation? What do we gain by doing so? What features does each have?
40
votes
4answers
32k views

Limit memory usage for a single Linux process

I'm running pdftoppm to convert a user-provided PDF into a 300DPI image. This works great, except if the user provides an PDF with a very large page size. pdftoppm will allocate enough memory to ...
25
votes
5answers
41k views

How to find which processes are taking all the memory?

I'm looking for somthing like top is to CPU usage. Is there a command line argument for top that does this? Currently, my memory is so full that even 'man top' fails with out of memory :)
24
votes
6answers
18k views

Correctly determining memory usage in Linux

I'm a bit confused on some of the results I am seeing from "ps" and "free". On my server, this is the result of "free -m" [root@server ~]# free -m total used free shared ...
22
votes
2answers
2k views

Will Linux start killing my processes without asking me if memory gets short?

I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some ...
22
votes
4answers
2k views

How to limit resource usage to save CPU+RAM for a certain process?

I have a dev server on which sshd sometimes stops working because the machine runs out of RAM. Yes we are running low on memory and upgrading is not a feasible choice right now. What I want to do is ...
20
votes
3answers
2k views

grep: memory exhausted

I was doing a very simple search: grep -R Milledgeville ~/Documents And after some time this error appeared: grep: memory exhausted How can I avoid this? I have 10GB of RAM on my system and few ...
19
votes
4answers
4k views

Measuring RAM usage of a program

time is a brilliant command if you want to figure out how much CPU time a given command takes. I am looking for something similar that can measure the max RAM usage of the program and any children. ...
17
votes
1answer
11k views

Getting information about a process' memory usage from /proc/pid/smaps

For a given process in /proc/<pid>/smaps, for a given mapping entry what are: Shared_Clean Shared_Dirty Private_Clean Private_Dirty Is Shared_Clean + Shared_Dirty the amount of memory that ...
16
votes
3answers
3k views

What does the vm.swappiness parameter really contol?

Per the kernel documentation: This control is used to define how aggressive the kernel will swap memory pages. Higher values will increase agressiveness, lower values decrease the amount of swap. ...
16
votes
1answer
1k views

What is maximum RAM supportable by Linux?

What is the maximum supportable RAM by Linux? Assume that hardware is/supports 64-bit. Among all Linux distros. Does it go up to 16 exabytes, or is it limited like with Windows which I believe is 192 ...
15
votes
6answers
5k views

Is there a way to limit the amount of memory a particular process can use in Unix?

I need to test a process for memory management. I do not have the source, so I need to do all the testing from the OS side. I want to be able to say something like limitmemory 400k -p <pid> ...
15
votes
2answers
2k views

How to blacklist a correct bad RAM sector according to MemTest86+ error indication?

MemTest86+ (the version included with Ubuntu 13.04) says Failing address: 002f796c48 - 759.5 MB What should I specify in the memmap kernel parameter to bypass this area? I've tried running ...
15
votes
2answers
783 views

Linux: Total swap used = swap used by processes +?

So, I'm trying to do some investigation on where does swap use come from in a system with high swap usage: # free total used free shared buffers cached Mem: ...
14
votes
3answers
7k views

How can I reserve a block of memory from the Linux kernel?

I have a device that needs a block of memory that is reserved solely for it, without the OS intervening. Is there any way to tell BIOS or the OS that a block of memory is reserved, and it must not ...
13
votes
4answers
4k views

How to re-load all running applications from swap space into RAM?

If my desktop run out of memory and swaps a lot then I free or kill the application wasting my RAM. But, after that, all my desktop/applications have been swapped and are horribly slow, do you know a ...
13
votes
3answers
3k views

How to detect memory type under Linux?

Which Linux utility can tell me if I have registered or unbuffered ECC memory in my server? Lshw and dmidecode do not work for me; dmidecode provides no information about registered vs. unbuffered: ...
13
votes
2answers
773 views

Why does Linux purge the memory cache when it is nearly full?

Here's what the memory graph looks like on a VPS running CentOS with 512MB of RAM and nginx/php-fpm/mysqld serving (mostly static) content to a couple thousand visitors per day. (those are days on ...
12
votes
4answers
5k views

How to display meminfo in megabytes in top?

Sometimes it is not comfortable to see meminfo in kilobytes while you have several gigs of RAM. In Linux it looks like that: And here is how it looks in Mac OS X: Is there a way to display ...
12
votes
4answers
2k views

Read the stack of another process?

I'm trying to read a child process's stack but with no luck. I know it is possible using ptrace, but ptrace's interface allows you to read only one word at a time, and I'm trying to scan a larger ...
12
votes
3answers
2k views

Increasing kernel memory size

I have an embedded board with 512MB of RAM running Linux 2.6.29 and UBoot bootloader. But the kernel is able to utilize only 128MB of RAM. I tried changing the value of XCODE_MEMSIZE, which I think ...
11
votes
2answers
11k views

How to create a user with limited RAM usage?

So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap ...
11
votes
1answer
699 views

Loading of shared libraries and RAM usage

I'm wondering about the way Linux manages shared libraries. (actually I'm talking about Maemo Fremantle, a Debian-based distro released in 2009 running on 256MB RAM). Let's assume we have two ...
11
votes
1answer
385 views

What is the difference between shared memory in early unix systems vs modern unix systems?

How could processes share memory in early versions of UNIX version modern implementations of shared memory?
11
votes
1answer
471 views

Does window minimizing free memory usage?

Both the undisplayed maximized window and minimized window are invisible to the end user. By undisplayed I mean an inactive maximized window covered by the active window. There is a difference ...
10
votes
1answer
5k views

How can I test the RAM for data corruption on an ARM-based system?

I have an embedded device. It is ARM based, with Linux 2.6.31 and has 256 MB RAM. I wanted to get some ideas/tips on what is the most effective way to test the device RAM for data corruptions. Is ...
10
votes
2answers
4k views

Why does my system show only 3.2 GiB of RAM when I definitely have 4.0 GiB

I have 2x2 GiB sticks of RAM installed. Running memtest86 from the grub boot menu confirms this.. memtest86 reports no errors. However every which way I check my available memory in a running ...
10
votes
3answers
525 views

After researching, still confused about monitoring RAM usage

I went through this article, which explains various methods for checking your RAM usage. However, I can't reconcile the different methods and don't know which one is correct. When I first login, I'm ...
10
votes
1answer
4k views

What does the Virtual kernel Memory Layout in dmesg imply?

While going through the "Output of dmesg" I could see a list of values which i am not able to understand properly. Memory: 2047804k/2086248k available (3179k kernel code, 37232k reserved, 1935k ...
10
votes
4answers
3k views

Shell command to read device registers?

On a single-board computer running Linux, is there a way to read the contents of the device configuration registers that control hardware? I think it would be a wrapper for inw(), more or less. I'm ...
9
votes
2answers
6k views

How to Determine the Amount of RAM Slots In Use?

I forgot how many RAM modules are installed on my laptop. I do not want to unscrew it but want to look it up on the console. How do I gather this information?
9
votes
6answers
3k views

Is there a tool that allows logging of memory usage?

I want to monitor memory usage of a process, and I want this data to be logged. Does such a tool exist?
9
votes
2answers
699 views

Memory management principle used by Linux

Is memory management in the Linux Kernel done using paging or segmentation or both?
9
votes
2answers
2k views

real memory usage

if I understand correctly, in the following output produced by free, 3535m is the actual free memory available to applications, only 413m is used, is this correct? need some clarification on the ...
9
votes
2answers
1k views

How can I dump the full system memory?

After starting VirtualBox, the computer became sluggish and then hung completely due to OOM. Usually, OOM should be starting killing processes in order to free up some space, but this did not happen ...
9
votes
2answers
506 views

How to solve this memory issue gracefully?

I have a standard Linux (Debian testing) laptop, with a swap partition. I do a lot of experiments with it. Some of them are really memory hungry and the way Linux behaves by default is an issue for ...
9
votes
2answers
351 views

On system memory… specifically the difference between `tmpfs,` `shm,` and `hugepages…`

I've been curious lately about the various Linux kernel memory based filesystems. Note: As far as I'm concerned, the questions below should be considered more or less optional when compared with a ...
8
votes
3answers
401 views

Physically break into box? (Memory & disk)

I have a VPS. I might be able to encrypt my partition but I havent tried. My VPS company I believe can reset my root password although the only SSH key I see is my own. With all my data I have it ...
8
votes
1answer
9k views

Need explanation on Resident Set Size/Virtual Size

I found that pidstat would be a good tool to monitor processes. I want to calculate the average memory usage of a particular process. Here is an example output: 02:34:36 PM PID minflt/s ...
8
votes
2answers
4k views

How to limit available virtual memory per process

Occasionally some processes on my GNU/Linux desktop (such as gv and gnash) use up the physical memory and cause thrashing. Since these processes aren't important, I want them to be automatically ...
8
votes
2answers
919 views

How to find out how much memory a program taking

I use htop to watch my processes, but most of services ran are multi threaded, so they are shown on several lines with a % of memory use which in some cases is the same for all, sometimes it varies ...
8
votes
3answers
514 views

Memory size for kernel mmap operation

I'm interested in the way Linux mmaps files into the main memory (in my context its for executing, but I guess the mmap process is the same for writing and reading as well) and which size it uses. So ...
8
votes
1answer
490 views

MySQL gets killed by OS every 25 days or so

About 4 months ago we migrated from MS SQL Server to MySQL 5.5. Since then we have been experiencing an issue once approximately ever 25 days since where CentOS runs out of memory and as a result it ...
8
votes
2answers
831 views

Kernel Panic because of RAM stick?

one of my RAM sticks causes a Kernel Panic on my Ubuntu 10.10 (something like "not syncing" with a lot of memory adresses shown on screen). It's definitely this one RAM stick and not its socket ...
8
votes
1answer
200 views

How to limit the total resources (memory) of a process and its children

There are plenty of questions and answers about constraining the resources of a single process, e.g. RLIMIT_AS can be used to constrain the maximum memory allocated by a process that can be seen as ...
7
votes
7answers
1k views

cron Vs. sleep - which is the better one in terms of efficient cpu/memory utilization?

The Case: I need to run some commands/script at certain intervals of time and for this I have two options - 1. set up a cron-job or, 2. implement a loop with sleep in the script itself. Question: ...
7
votes
3answers
1k views

Exploring RAM contents

I am using a redis Database and would like to explore the contents of the RAM the application is using. I feel the explanation of why I want to do this will make more sense then the question I would ...