zram is a driver in linux kernel. It compress the content in memory to reduce the pages used by application.
modprobe zram num_devices=1
# Now you have a /dev/zram0
echo 8G > /sys/block/zram0/disksize
# Must set size before using it
mkfs.ext4 -I 128 -m 0 /dev/zram0
# /dev/zram0 is only a block device therefore we need to create a simple filesystem on it
mount /dev/zram0 /mnt/
# Now you can put some files into /mnt/ and you will find that they will occupied less space.
But that’s not the only way we could use zram. Furthermore, we could use zram with tcmalloc to reduce user application’s cost of memory.
LD_PRELOAD="/usr/lib/libtcmalloc.so" TCMALLOC_MEMFS_MALLOC_PATH=/mnt/ redis-server
Now we make redis-server… Read more »
I worked in Alibaba Group for more than 9 years. Recently I am working in Alimama, a sub-company of Alibaba Group and has been the biggest Advertisement Publishing Company in China. At present, we need C++/Java developers to build new back-end basic services for our new business. [Job Description] Role:… Read more »
1. If we see this error report:
Container XXX is running beyond virtual memory limits
The solution is here, the heap size of Java should not be bigger than map/reduce memory. The Cloudera recommends the head size prefer to be 0.8 of the map/reduce memory, such as:
2. The directory of “/tmp/” became full. This is… Read more »