Tag Info

Hot answers tagged

41

/proc/$pid/maps /proc/$pid/mem shows the contents of $pid's memory mapped the same way as in the process, i.e., the byte at offset x in the pseudo-file is the same as the byte at address x in the process. If an address is unmapped in the process, reading from the corresponding offset in the file returns EIO (Input/output error). For example, since the first ...


24

On a 32-bit architecture, the address space range for addressing RAM is: 0x00000000 - 0xffffffff or 4'294'967'295 (4 GB). The linux kernel splits that up 3/1 (could also be 2/2, or 1/3) into user space (high memory) and kernel space (low memory). The user space range: 0x00000000 - 0xbfffffff Every newly spawned user process gets an address (range) ...


18

This exact same question was asked on serverfault just the other day :-) The linux virtual memory system isn't quite so simple. You can't just add up all the RSS fields and get the value reported used by free. There are many reasons for this, but I'll hit a couple of the biggest ones. When a process forks, both the parent and the child will show with the ...


15

ulimit is made for this. You can setup defaults for ulimit on a per user or a per group basis in /etc/security/limits.conf ulimit -v KBYTES sets max virtual memory size. I don't think you can give a max amount of swap. It's just a limit on the amount of virtual memory the user can use. So you limits.conf would have the line (to a maximum of 4G of ...


14

This is relevant to the Linux kernel; I'm not sure how any Unix kernel handles this. The High Memory is the segment of memory that user-space programs can address. It cannot touch Low Memory. Low Memory is the segment of memory that the Linux kernel can address directly. If the kernel must access High Memory, it has to map it into its own address space ...


14

What you're asking for is called DMA. You need to write a driver to reserve this memory. Yes, I realize you said you didn't want the OS to intervene, and a driver becomes part of the OS, but in absence of a driver's reservation, the kernel believes all memory belongs to it. (Unless you tell the kernel to ignore the memory block, per Aaron's answer, that ...


13

From inside top you can try the following: Press SHIFT+f Press the Letter corresponding to %MEM Press ENTER You might also try: $ ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head -5 This will give the top 5 processes by memory usage.


13

A 32-bit address space means that you have space for 4GB of addresses. Ideally the kernel likes to be able to map all physical memory, all the memory of the current task, and all of its own memory. If physical memory alone takes up all of the available 4GB, that won't work. So physical memory is divided into low memory, which is mapped all the time, and high ...


13

If you want the OS to totally ignore it, you need to make a memory hole using "memmap." See this reference. For example, if you want 512M at the 2GB barrier, you can put "memmap=512M$2G" on your kernel command line. You will need to check your dmesg to find a contiguous hole to steal so you don't stomp on any devices; that is specific to your ...


13

The general solution to test memory is to write a specific pattern like 0xFFFFFFFF to your memory and read it afterwards and compare the result. You can and should of course alter the pattern to discover problems. Some solutions like memtest86+ also generate random patterns and change the direction they use to write to the memory. For more detailed ...


12

You can use tstime to measure the highwater memory usage (RSS and virtual) of a process. For example: $ tstime date Tue Aug 16 21:35:02 CEST 2011 Exit status: 0 pid: 31169 (date) started: Tue Aug 16 21:35:02 2011 real 0.017 s, user 0.000 s, sys 0.000s rss 888 kb, vm 9764 kb It also supports a more easy to parse ...


12

As a general rule, physical access to the machine is all that's ever needed to compromise it. You are, after all, trusting that what the machine tells you is true; a person with physical access can void that trust. Consider that an attacker with physical access can theoretically do anything (including installation of hardware/firmware rootkits, etc). If the ...


11

ulimit -v, it's a shell builtin, but it should do what you want. I use that in init scripts sometimes: ulimit -v 128k command ulimit -v unlimited It seems however, that you want ways of manipulating the maximum allocatable memory while the program is running, is that correct? Probably something like renice for manipulating the Priority. There is, ...


11

You could try running (as root) dmidecode -t memory. I believe that's what lshw uses (as described in the other Answer), but it provides information in another form, and lshw isn't available on every linux distro. Also, in my case, dmidecode produces the Asset number, useful for plugging into Dell's support web site.


10

Here's what lshw -c memory (as root) gives me: *-firmware description: BIOS vendor: Acer physical id: 0 version: V1.41 (01/07/08) size: 113KiB capacity: 960KiB capabilities: isa pci pcmcia pnp upgrade shadowing escd cdboot acpi usb agp biosbootspecification *-cache:0 description: L1 ...


10

You should read the dmesg values "Memory Akb/Bkb available" as: There is A available for use right now, and the system's highest page frame number multiplied by the page size is B. This is from arch/x86/mm/init_64.c: printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " "%ldk absent, %ldk reserved, %ldk data, %ldk ...


10

Clean pages are pages that have not been modified since they were mapped (typically, text sections from shared libraries are only read from disk (when necessary), never modified, so they'll be in shared, clean pages). Dirty pages are pages that are not clean (i.e. have been modified). Private pages are available only to that process, shared pages are mapped ...


9

Very early UNIX systems did not have MMUs, and so effectively, all memory in the system was shared between all processes in memory. UNIX V7 was the first one that had memory management, AFAIK. The PDP-11 did not even have a MMU when it was released; see this PDF book, page 35. As time moved forward and MMUs became a commonplace thing, UNIX began to ...


9

The buffers and cache are dynamically sized. If processes need more space, then it is taken from the buffers and the cache. The key is to look at the second line ("-/+ buffers/cache"). Mem: 496 489 6 0 4 452 -/+ buffers/cache: 33 462 Notice that the free in the second line (462) is the ...


9

32-bit x86 CPUs (since the Pentuim Pro) support up to 64 GiB RAM (using PAE). (The "CONFIG_HIGHMEM64G" kernel option needs to be set to actually use it). Each application can only see 4 GiB at a time (and some of that 4GiB must be used for other things, the exact amount depending on the "Memory split" kernel setting) 64-bit operating systems have some other ...


8

The first reference to turn to is Linux Device Drivers (available both online and in book form), particularly chapter 15 which has a section on the topic. In an ideal world, every system component would be able to map all the memory it ever needs to access. And this is the case for processes on Linux and most operating systems: a 32-bit process can only ...


8

First off, a 32 bit system has 0xffffffff (4'294'967'295) linear addresses to access a physical location ontop of the RAM. The kernel divides these addresses into user and kernel space. User space (high memory) can be accessed by the user and, if necessary, also by the kernel. The address range in hex and dec notation: 0x00000000 - 0xbfffffff 0 - ...


8

You can run a multi-process operating system even with no hardware support (no MMU), with all pointers representing a physical address. You do however lose several key features usually provided through the MMU: Since a pointer always points to a specific place in RAM, you can't have swap (or only in a very limited way). Normally, the MMU raises an ...


8

You can probably achieve something like that by using cgroups with the Memory resource controller. I guess you'd put all your resource-consuming tasks in a limited (CPU & RAM) cgroup, and leave sshd "outside" so that it isn't restricted. (Adding more swap, even in the form of a swap file, might be a good option though.)


8

Minimizing a window might free a little memory, but it depends on the application, and it won't amount to much. In any case, minimizing won't make more difference than any other form of hiding. Even if an application's window is minimized, it's still running. The application isn't going to need to keep less data in memory just because one of its windows is ...


8

Run top, hit h for help then f to add fields. you can add the following fields: RSS amount of physical memory the application is using CODE total amount of memory the process's executable code is using DATA - total amount of memory (kb) dedicated to a process's data and stack Between these 3 you should have pretty accurate results. You can also use more ...


8

The man page you refer to comes from the procps version of top. But you're on an embedded system, so you have the busybox version of top. It looks like busybox top calculates %MEM as VSZ/MemTotal instead of RSS/MemTotal. The latest version of busybox calls that column %VSZ to avoid some confusion. commit log


8

You just need to understand Memory Concept As per your Output Of /proc/meminfo , You just need to Notice below things : Buffers :- A buffer is something that has yet to be "written" to disk. it represent how much portion of RAM is dedicated to cache disk block. "Cached" is similar like "Buffers", only this time it caches pages from file reading Cached ...


7

Many Distributions offer what is called a Just Enough Operating System, or JeOS. How you go about installing these varies from distro to distro. Under Debian based distributions, such as Ubuntu, if you use a Server Install ISO, you can install the JeOS by pressing F4 on the first menu screen to pick "Minimal installation". Many distributions also provide ...



Only top voted, non community-wiki answers of a minimum length are eligible