I searched how to limit memory usage for a single process and found 3 results,ulimit -d, -m and -v, which stand for data seg size(process's data segment), max memory size(resident set size) and virtual memory. I am confused about what these "memory"  mean.
120857
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 some example output:  02:34:36 PM       PID  minflt/s  majflt/s     VSZ    RSS   %MEM  Command 02:34:37 PM      7276      2.00      0.00  349212 210176   7.14  scalpel   (This is part of the output from pidstat -r -p 7276.)  Should I use the Resident Set Size (RSS) or Virtual Size (VSZ) information to calculate the average memory consumption? I have read a few thing on Wikipedia and on forums but I am not sure to fully understand the differences. Plus, it seems that none of them are reliable. So, how can I monitor a process to get its memory usage?   Any help on this matter would be useful.
70304
From the Wikipedia page of  I get the impression that TRIM was introduced to lower the writes to a SSD, but letter the file system taking case of which blocks are unused.  If that is correct, does that mean, that SSD's that don't use TRIM writes zeros to the blocks, when a file is deleted, to let the SSD know the blocks are free?  Reading      File systems within a guest tend to   not reuse blocks which means that even   if a file system remains small   relative to the virtual image size,   the actual image size tends to grow   until it reaches the maximum size.   leads me to think, SSD's don't overwrite with zeros? Or are file systems in guests, something completely different?
65195
If I write a program that tries to read memory at every possible address, and I run it on a "full" Unix, it will not be able to access all of the physical RAM.  But how does the operating system prevent it from doing so?  I am more familiar with small CPU architectures where any piece of assembly code can access everything. I don't understand how a program (the kernel) can detect such malicious operations.
82916
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 avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)?  Update:  So I opened terminall and typed into it  command: ulimit -v 1000000 which shall be like 976,6Mb limitation. Next I called ulimit -a and saw that limitation is "on". Then I started some bash script that compiles and starts my app in nohup, a    nohup ./cloud-updater-linux.sh  &gt;&amp; /dev/null &amp;... but after some time  I saw:    (which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.)  But I thought I applied limitations to the shell and all processes launched with/from it with ulimit -v 1000000? What did I get wrong? How to make a terminal and all sub processes it launches be limited on ram usage?
59383
Is Kernel space used when Kernel is executing on the behalf of the user program i.e. System Call? Or is it the address space for all the Kernel threads (for example scheduler)?  If it is the first one, than does it mean that normal user program cannot have more than 3GB of memory (if the division is 3GB + 1GB)? Also, in that case how can kernel use High Memory, because to what virtual memory address will the pages from high memory be mapped to, as 1GB of kernel space will be logically mapped?
26740
In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time.  From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new() or alloc() and unitilialized.  While "CD" represents delete'd or free'd memory.  I've only seen "baadf00d" in RELEASE build (but I may be wrong).  Once in a while, we get into a situation of tacking memory leaks, buffer overflows, etc and these kind of information comes in handy.  Would somebody be kind enough to point out when and in what modes the memory are set to recognizable byte patterns for debugging purpose?
96156
There is only one partition for both system files and personal data, which is C:. The other two partitions are for boot and for recovery.  Now I have two different reports on the size of C: on my Windows 7:   by clicking the property of C:, it shows 59.4 GB for "used space"; by selecting all contents (I have setup to view all hidden files and directories) under C: and viewing their property, it shows 46.9 GB for "size" and 47.6 GB for "size on disk".   Here are my questions:   I was wondering why the two reports are not the same, and where the difference comes? in the second way, why "size" and "size on disk" are different? What do they mean actually? What is the difference between them and "used space" in the first way?   Thanks in advance!
2642
My Vista 64 installation has drive C, a 150 GB hard drive.  I also has a 1.5 TB drive D.  My C drive has 12.3 GB free.  I don't know what's using up all the space.  There's almost 83 GB unaccounted for!!!  As per  question and  question, I downloaded  and .  WinDirStat, once I found the right options, tells me there's 82.9 GB of .  SpaceMonger, which has a particularly nice display of the data, tells me there's 82.3 GB "Unscanned", with 2 unscannable folders.  Where do I turn now?  Both tools roughly agree there's a large amount of data on my drive, but neither seem to be able to tell me what.  I've tried the standard approach; disk cleanup, remove hibernation file, set the virtual memory to the D drive instead of the C drive.
37645
I would appreciate help in interpreting the output of 'free -m' below.    -bash-4.2$ free -m               total        used        free      shared  buff/cache   available Mem:          15793        7112          88        7840        8591         611 Swap:         16891        5289       11602    If I have nearly 11GB free then why am I seeing swap usage.  Shouldn't that be 0?   Also, the 'shared' value is 7840.  Is this memory available for a new application? Is only 'cache' memory available for new applications?  In other words, 'shared' and 'buffer' memory are not available for new applications? How should I interpret the 'available' column with a value of 611?  How is this value arrived at?
84218
During process execution, when the memory map of a process is like so:    This might be a silly question, but what is responsible for reserving the Kernel space in the address space? Are user processes responsible for this? privileged processes? all processes?  From my understanding, the kernel memory space is reserved by the process running but it is only accessible by the CPU when instructed to execute under ring 0. Is this correct ?
58018
I am not quite understanding the difference between /dev/random and /dev/urandom on Linux systems.  What does it mean to run out of “entropy” and how does the system get more?  What does it mean when people say /dev/random “blocks” if there isn’t enough entropy?  Which one should I use for what scenarios?
19077
I developed an algorithm for a fairly hard problem in mathematics which is likely to need several months to finish. As I have limited resources only, I started this on my Ubuntu 12.04 (x86) laptop. Now I want to install some updates and actually restart the laptop (the "please reboot" message is just annoying).  Is there a way to save an entire process including its allocated memory for continuation beyond a reboot?  Here is some information about the process you might need. Please feel free to ask for further information if needed.   I called the process in a terminal with the command "./binary &gt; ./somefile &amp;" or "time ./binary > ./somefile &amp;", I cannot really remember. It's printing some debug information to std::cerr (not very often). It's currently using roughly 600.0 kiB and even though this will increase, it's unlikely to increase rapidly. the process runs with normal priority the kernel is 3.2.0-26-generic-pae, the cpu is an AMD, the operating system is Ubuntu 12.04 x86. it runs since 9 days and 14 hours (so too long to cancel it ;-) )
105080
$ df -kh Filesystem      Size  Used Avail Use% Mounted on udev            7,8G     0  7,8G   0% /dev tmpfs           1,6G   19M  1,6G   2% /run /dev/sda2       622G  227G  364G  39% / tmpfs           7,8G  1,1G  6,7G  14% /dev/shm tmpfs           5,0M  4,0K  5,0M   1% /run/lock tmpfs           7,8G     0  7,8G   0% /sys/fs/cgroup /dev/loop1      143M  143M     0 100% /snap/inkscape/2527 /dev/loop3       79M   79M     0 100% /snap/core/1441 /dev/loop0       79M   79M     0 100% /snap/core/1577 /dev/loop4       79M   79M     0 100% /snap/core/1512 /dev/loop2       62M   62M     0 100% /snap/pencilsheep/5 tmpfs           1,6G   92K  1,6G   1% /run/user/1000   What are these /dev/loop device files? My RAM is always full. Is this related?
51752
I'm building a Core  system which supports dual-channel memory (up to 16&nbsp;GB in four DIMMs), my target is 8&nbsp;GB. From the performance perspective, is it better to have two times 4&nbsp;GB or four times 2&nbsp;GB?
34712
Ubuntu has been crashing on me recently. I think its because it runs out of memory so I ran the free -m command and found that my memory usage was really high. So then, i ran top to find the culprit, but the displayed processes were using less than 1.5% of memory. How do I know which program is making ubuntu crash/run out of memory? Below is the output:  shafee@shafee-pc:~$ free -m              total       used       free     shared    buffers     cached Mem:          3824       3714        110          0        978       1954 -/+ buffers/cache:        780       3044 Swap:           99          0         99  shafee@shafee-pc:~$ top top - 02:12:14 up  1:24,  2 users,  load average: 0.16, 0.42, 1.49 Tasks: 182 total,   1 running, 181 sleeping,   0 stopped,   0 zombie Cpu(s):  2.9%us,  1.9%sy,  0.3%ni, 79.3%id, 15.5%wa,  0.0%hi,  0.2%si,  0.0%st Mem:   3916708k total,  3803848k used,   112860k free,  1002308k buffers Swap:   102396k total,        0k used,   102396k free,  2001852k cached    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND              4200 root      20   0  289m  53m  38m S    2  1.4   1:06.45 Xorg                 5590 shafee    20   0 19348 1368  956 R    2  0.0   0:00.01 top                     1 root      20   0 24124 2136 1264 S    0  0.1   0:02.05 init                    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd                3 root      20   0     0    0    0 S    0  0.0   0:24.23 ksoftirqd/0             6 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0             7 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1             9 root      20   0     0    0    0 S    0  0.0   0:00.11 ksoftirqd/1            11 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/2            13 root      20   0     0    0    0 S    0  0.0   0:03.89 ksoftirqd/2            14 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/3            16 root      20   0     0    0    0 S    0  0.0   0:00.16 ksoftirqd/3            17 root       0 -20     0    0    0 S    0  0.0   0:00.00 cpuset                 18 root       0 -20     0    0    0 S    0  0.0   0:00.00 khelper                19 root       0 -20     0    0    0 S    0  0.0   0:00.00 netns                  21 root      20   0     0    0    0 S    0  0.0   0:00.01 sync_supers         shafee@shafee-pc:~$   Or is it normal to have 110mb of free memory and is my issue related to something else?
14897
I know this is a common convention, but what does the "k" in variable names signify? (i.e. kMaxImageViewSize)  I looked in the Apple documentation on Variable names and found no mention of it.  Thanks for answering
107956
When i installed ubuntu in my x86 machine, I had to configure some memory as 'swap area'.  What is the use of this memory and what is the importance of this memory in linux file systems?  How can I determine the exact size of 'swap area' in a machine for the safe working of linux inside in it?