Skip to content
Advertisement

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 restored GOT. However, I can’t figure out

Why the address of the pointer variable printed differently between two printf statements without any modification to the variable?

In below simple c test program two printf statements return different values. ( check last four printf statements). output : – I am running it in eclipse ide and using Ubuntu Linux. Why does it behave differently? Answer In several places you are using the wrong format specifier to printf. In particular, on this line: The first parameter has type

What HW resource is mostly used when one does memcpy()?

This feels like a very newbie question, but I suddenly find myself clueless. I’m trying to profile a c application that does a lot of memory copies, and there is an option for me to reduce that number (requires some re-design). I’m trying to realize if it’s worth it, but I have no idea what resource it will affect, or

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: Where

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 else wrote, which I must

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 built-in time command.

Advertisement