I had run valgrind on a sample daemon program. The parent exits after allocating a chunk of 1000B, but the child that runs on the background keeps on allocating 200B of memory on the heap through malloc, after every two seconds.
My question is: does valgrind execute the program on the actual processor, or on a synthetic CPU?
Does it allocate the memory on the actual heap or on a synthetic RAm which doesn't exist?
Since I let the program run for a quite a long duration so much so that the child allocated some 2GB of memory on the heap. On implementing the program on massif, I got one output file for the parent, and on killing the daemon process, I got another massif.out. for the child which showed the allocation of the memory on the heap.
If you turn on the memcheck(which is the default), then Valgrind will manage the heap, i.e. all the memory related methods (malloc/free/memmove etc.) will be replaced by Valgrind's version of the corresponding methods.
As already told, your program is running on virtual CPU created and managed by valgrind.
There is no notion of synthetic RAM as far I know. In any case, all this is very transparent to the running process(your daemon) and shoudl not change the behavior of your program in any way.
So the answer is YES for synthetic CPU and no for synthetic RAM.