Am 21.11.18 um 13:33 schrieb Carlos E. R.:
Well, no, it seems systemd-timesyncd uses much more memory.
You are looking at the wrong field.
Nobody realy cares how much virtual memory a process has mapped /
reserved, but instead how big its resident set size is.
Example how to "use" 4G of memory:
seife@strolchi:/dev/shm> cat test.c
#include
#include
#include
#include
#include
#define handle_error(msg) do { perror(msg); exit(EXIT_FAILURE); } while (0)
int main(int argc, char *argv[])
{
char *addr;
size_t length = 1024L*1024*1024*4; /* 4GB */
int fd = open(argv[1], O_RDONLY);
if (fd == -1)
handle_error("open");
addr = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, 0);
if (addr == MAP_FAILED)
handle_error("mmap");
while (1)
sleep(1);
/* not reached */
munmap(addr, length);
close(fd);
return 0;
}
seife@strolchi:/dev/shm> gcc test.c -o test
seife@strolchi:/dev/shm> truncate -s 10G test.file
seife@strolchi:/dev/shm> ./test test.file &
[1] 1905
seife@strolchi:/dev/shm> ps u 1905
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
seife 1905 0.0 0.0 4198484 672 pts/10 S 13:52 0:00 ./test test.file
recompile with different "length=" and you can "use" even more.
--
Stefan Seyfried
"For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled." -- Richard Feynman
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org
To contact the owner, e-mail: opensuse-factory+owner@opensuse.org