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 killed if they use too much memory.  I think the /etc/security/limits.conf file and the -v option could be used for this.  The question is whether it limits the amount of available memory per process of a particular user, or the sum for all the processes of a user.  Also I would like to ask how to make change to that file in effect without rebooting.
5551
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 hold a 300DPI image of that size in memory, which for a 100 inch square page is 100*300 * 100*300 * 4 bytes per pixel = 3.5GB.  A malicious user could just give me a silly-large PDF and cause all kinds of problems.  So what I'd like to do is put some kind of hard limit on memory usage for a child process I'm about to run--just have the process die if it tries to allocate more than, say, 500MB of memory.  Is that possible?  I don't think ulimit can be used for this, but is there a one-process equivalent?
26354
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 applications running, so I am really surprised a simple grep runs out of memory. ~/Documents is about 100GB and contains all kinds of files.  grep -RI might not have this problem, but I want to search in binary files too.
24521
When I open a RAM-intensive app (VirtualBox set at 2GB of RAM), some swap space is generally used, depending on what else I have open at the time.  However, when I quit that last application, the 2GB of RAM is freed up, but the same swap space use remains.  For example, right now, about two hours after having closed VirtualBox, I have 1.6GB free RAM and still 770MB in swap.  How can I tell Ubuntu to stop using that swap and to revert to using the RAM?
7166
How to limit process to one cpu core ?  Something similar to ulimit or cpulimit would be nice. (Just to ensure: I do NOT want to limit percentage usage or time of execution. I want to force app (with all it's children, processes (threads)) to use one cpu core (or 'n' cpu cores)).
83816
I have a requirement to hide a process in Task Manager. It is for Intranet scenario. So, everything is legitimate. :)   Please feel free to share any code you have (preferably in C#) or any other techniques or any issues in going with this route.  Update1: Most of the users have admin privileges in order to run some legacy apps. So, one of the suggestion was to hide it in task manager. If there are other approaches to prevent users from killing the process, that would be great.  Update2: Removing the reference to rootkit. Somehow made this post look negative.
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?
58518
I'm on Kubuntu 11.04, and deleting in Krusader I get "Thrash has reached maximum size" even when I have 10M in ~/.local/share/Trash/files. So my question is why is that? How do I set the allowed size of the trash bin?
48449
I wrote a program that uses POSIX memory-mapping function (mmap)  The program takes a file (a.dat) and memory-maps it for reading/writing.  Due to errors in the program, every time I run the program a file with some weird names (e.g., ?d?P?^z??d?P?^z?) is created. The error is resolved but I am not able to delete the files.  I am not able to delete it either using command line or by select/deleting from window manager.  So how should I delete it? I'm using Ubuntu 11.04.
53259
Is it ever acceptable to have a  in your C or C++ application?  What if you allocate some memory and use it until the very last line of code in your application (for example, a global object's destructor)? As long as the memory consumption doesn't grow over time, is it OK to trust the OS to free your memory for you when your application terminates (on Windows, Mac, and Linux)? Would you even consider this a real memory leak if the memory was being used continuously until it was freed by the OS.  What if a third party library forced this situation on you? Would refuse to use that third party library no matter how great it otherwise might be?  I only see one practical disadvantage, and that is that these benign leaks will show up with memory leak detection tools as false positives.
8780
This is a  about File Permission and Why 777 is "destructive".   I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault (reinstall OS). Why does it do anything destructive at all?  If you've ever ran this command you pretty much immediately destroy your operating system. I'm not clear why removing restrictions has any impact on existing processes. For example, if I don't have read access to something and after a quick mistype in the terminal suddenly I now have access well... why does that cause Linux to break?
45242
Some times my laptop gets stuck due to excessive usage of RAM when I open bulky applications. So if it does not respond I shut down the laptop using the power button. Does this damage Ubuntu in any way? Can it give rise to security problems or vulnerabilities?
111897
I put my program in startup applications because of this. The directory /var/log is taking around 36 GB space.   Can I delete syslog and syslog.1 file which are taking the highest percentage of storage in /var/log directory?
47181
On Windows, under normal circumstances a 32 bit process can only access 2GB of RAM (or 3GB with a special switch in the boot.ini file). When running a 32 bit process on a 64 bit operating system, how much memory is available? Are there any special switches or settings that can change this?
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 ;-) )
82161
Sometimes I have to use some propriety softwares which I don't trust or even pre-compiled open source ones which I don't know if they've been compiled as their source are.   Lets say we installed a propriety application in /opt/software, then we run it as a normal user (without sudo, gksudo, etc).   I know when we run a program it is able to connect to the Internet, monitor X, keystrokes, collect user data and so on. It can't change anything important in the system or infect the system, (because of the Linux permissions system). It is possible for program to add some plug-in/extension to a user's browser (Because browser profiles are available in user home directory). After closing the program and rebooting it can't do anything anymore. Wrong because:   Program can add itself to a shell/file/directory which does the autostart process, so it will run at any login.  If we consider the autostart process clean, without rebooting there is a chance that a process of the program is still active. Programs can delete or modify any file in the user home directory (or any other file which a user has write permission to).   So what should we do?   I think the only safe way to run a propriety program is running it as another user. If running the program as another user somehow is not possible then we should change the autostart files permission so only root can change them. then after closing the program a reboot will do the job.   Am I right? Is there anything that I'm missing?
83973
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 of my processes were Killed, as my terminal reported to me. Several programs had already successively completed before the programs that were later Killed started, but all the programs afterwards failed in a segmentation fault (which may or may not have been due to a bug in my code, keep reading).  I looked at the usage history of the particular cluster I was using and saw that someone started running several memory-intensive processes at the same time and in doing so exhausted the real memory (and possibly even the swap space) available to the cluster.  As best as I can figure, these memory-intensive processes started running about the same time I started having problems with my programs.  Is it possible that Linux killed my programs once it started running out of memory?  And is it possible that the segmentation faults I got later on were due to the lack of memory available to run my programs (instead of a bug in my code)?
82218
To prevent fork bomb I followed this   ulimit -a reflects the new settings but when I run (as root in bash) :(){ :|:&amp;};: the VM still goes on max CPU+RAM and system will freeze.   How to ensure users will not be bring down the system by using fork bombs or running a buggy application?  OS: RHEL 6.4