Skip to content

Tag: memory

How to create an ELF executable from process memory image

First of all, Engilish is not my native language. Please excuse if there are any mistakes. As stated above, I want to create an ELF executable from process memory image. Up until now, I successfully extracted an ELF Header, Program Headers and a list of Elf64_Dyn structures resides in Dynamic segment. I also …

Get hardware information from /proc filesytem in Linux

I use execv to run lshw command to get the CPU, disk, and memory in C code. But I would like to search another solution to get these information from /proc or any other existed data. Have any suggestion? Here is my code: Linux command: $ sudo lshw -short -c disk -c processor -c memory I have two questions: Wh…

Mitigating memory leaks by forking

This is a really ugly question. I have a C++ program which does the following in a loop: Waits for a JMS message Calculates some data Sends a JMS message in response My program (let’s call it “Bob”) has a rather severe memory leak. The memory leak is located in a shared library that someone …

Memory used by compiling a code

I use time command to measure the time used to execute a file as: My question: are there any command like time can give the memory used by executing an executable file in linux? Answer You can use /usr/bin/time -v ./filename. It will print a lot of information including memory use. Note: Will use the shell bu…