Opera, memory usage and the working set
Monday, March 6, 2006 2:04:17 PM
The working set actually tells you how many virtual pages in the process are mapped into physical memory.
What the OS will do, when an application such as Opera is using external DLLs or even other parts of opera.dll, is to map that part of the dll into the virtual address space of Opera. The actual memory used will not increase, only the working set.
To use an example for the technical people out there:
- Open a file
- Call CreateFileMapping to create a mapping handle
- Call MapViewOfFile twice to create two different identical views on the same file
- Try looping through just one of the views and look at what that does to your process' working set
- Now try looping through both views and look at what that does to your process' working set
The result you will find is that the working set from #5 is double the working set from #4. However, the OS isn't using any more physical memory in #5 then in #4. So #5 will show as twice the memory used in the task manager, but in reality, there is very little difference in the physical memory used!
Now, if you minimize Opera, you will see that the memory used in task manager will decrease significantly. This is because the working set is freed by the OS.
Another thing worth noting is that plugins will add to the working set of Opera, some in a significant way.
I hope this clears up some points.