Hot answers tagged

16

Often a mv is closer to a rename than a copy. In a classic unix type file system, the inodes that contain the file data won't be replicated if the source and the destination are on the same mount point. Instead a new filename is created that points to the same inodes, and the old filename is unlinked. If the mv is to another mount point, then it will be ...


3

You can use ps together with awk to find the physical memory usage by a user: ps -U root --no-headers -o rss | awk '{ sum+=$1} END {print int(sum/1024) "MB"}' Here it prints memory used by root to the output.


2

Running this: perl -e '$a="x"x1000000000;sleep(10);print"done\n"' takes up 1.8GB RAM. So you would expect running this: perl -e '$a="x"x1000000000;fork;fork;fork;fork;sleep(10);print"done\n"' would take up 16 times as much. But it does not. This is due to the Linux kernel's intelligent copy-on-write: Because the contents of '$a' does not change, then ...


2

No. First the .so file is opened, then mmap() creates the virtual address space necessary to hold the whole file contents. However, only when something tries to access a particular address in the space will the access cause a page fault, and the kernel will read a (4k) block from the file corresponding to the page's offset into real memory. When it is in ...


1

Total_vm was badly calculated by me and the OOM report is correct. app has allocated 59739 pages which is 233MB. So, this is the correct reason of OOM.


1

Get the PID of the scala process you want to track using SCALAPID=$! after starting the scala process in background then find the memory usage of the process using ps -o size= -q $SCALAPID the returned value is in kilobytes


1

Maybe you can use nocache. It's a small program that you use like nocache cmd.


1

I have a feeling that this document will help you a lot (Sections 5.5 and 5.2 especially). I will try to summarize as best I can here. The best explaination that I have is that the numbers provided in memory.usage_in_bytes are not incredibly precise, but are intended to provide a general idea about the amount of memory something is using. memory.stat is ...


1

I think smem is the better tool in your case. Install smem and try smem -uk If you are using debian you can install it using: apt-get install smem If you cant install nothing on the server you can try: ps haux | awk -v user=$USER '$1 ~ user { sum += $4} END { print user, sum; }' Remember that $USER is a environment variable so you don't need to ...


1

I have created a script, kill-process, that kills some processes listed in an array, if CPU usage is greater than XX% for YY seconds or kill processes that's running more than ZZ seconds. You can set XX, YY, ZZ in the top of the file. You can use a ps or top for check processes. There's a dry run mode too, to check but not kill. In the end, the script ...


1

this command will display result in "GB" svmon -G -O unit=GB if you want in "MB", just change the unit value to MB



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