Limiting memory consumption in Java script
What is even more confusing is that when debugging the heap (using valgrind on linux, Memory Validator on Win32, and umdh on Win32) the heap reported looks normal and growth is as expected; no leaking objects. However, the task manager in win32 reports that memory is growing consistently. Is there any trickery used in QtWebKit on win32 for allocating memory?
Finally, is there any way to:
Thanks in advance,-BMS
This is a poor answer to the problem though, as restarting is not always feasible in all cases.
Assistance would be greatly appreciated in this matter.
The approach I’m now working on is using process spawning to avoid this problem.
Basically, I construct a separate process which creates a shared memory segment (QSharedMemory), and writes output to stdout. The shared memory segment is a data channel (containing the RGBA buffer for a QPainter), and stdout is the command channel (e.g. pick up freshly rendered content on this qrect).
The main process connects to this shared memory segment using QSharedMemory, and instantiates the process with QProcess.
Because I need Win32 compatibility, I need to suck the big one and create a new process every time a web page is spun-up – using a new QProcess instance. On unix, however, I believe that one could create one main process and call fork() every time a new web view is required. This would allow the parent process to do much of the setup work prior to forking, thus an efficiency gain. If you are on unix you may be able to use this approach.