Skip navigation.

Innuendo and out the other

About Opera and stuff

Opera, memory usage and the working set

, ,

There's a commom misconception that the working set of an application, as seen in the task manager, is the amount of physical memory the application is using. This is not entirely correct.

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:

  1. Open a file
  2. Call CreateFileMapping to create a mapping handle
  3. Call MapViewOfFile twice to create two different identical views on the same file
  4. Try looping through just one of the views and look at what that does to your process' working set
  5. 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.

Desktop Team blog and weekly buildsThe arrogance of larger companies

Comments

gun 6. March 2006, 18:23

I always told people to minimize Opera if they are concerned about it's memory usage. I'll now point to this blog if people are yelling "Opera is a memory hog". :wink:

chesss 7. March 2006, 08:42

Nice, really nice!!

But then how to find out the actual memory consumption of a process?

mitchman2 7. March 2006, 10:09

Download http://www.sysinternals.com/Utilities/ProcessExplorer.html and add the Private Bytes column to the process view, that should show that memory allocated by the application that can not be shared with other applications (hence the naming "private").

jp10558 7. March 2006, 15:51

So, I'm pretty confused then. How can private bytes be more than the working set?

I have 1GB RAM. 92,920K private bytes, 436,056 Virtual Size, 61,840 Working set.

Can someone lead me through this?

mitchman2 7. March 2006, 18:02

Private Bytes is not included in the working set.

mitchman2 9. March 2006, 10:53

The Task Manager will show Private bytes + working set in its memory column.

shogunu 11. March 2006, 18:29

Right now, the Private bytes are 80668 K, the Working set is 73284 K and the Task Manager shows 73284 K Memory usage.
So how is it actually?

mitchman2 12. March 2006, 18:20

I was incorrect, VM Size in task manager is the same as the the process explorer's private bytes setting, and it appears that the mem use in task manager is the working set, and nothing else.

Better use process explorer :smile:

chesss 13. March 2006, 21:49

So finally how do you see the actual memory?? Currently Opera's usage as shown in process explorer :
Private bytes: 86mb
virtual bytes: 187mb
working sets: 24mb

System memory:256mb, Opera is minimized

chesss 13. March 2006, 22:02

I found something:
http://shsc.info/WindowsMemoryManagement

- for anyone interested to know how all this works(its a lot more complicated than I ever thought), or just interested in getting a headache or just to get throughly confused.

tony2006 20. April 2006, 02:27

i just have registered on this web.
eXtended Task Manager (XTM) is a powerful auxiliary tool designed for simplifying the environment of the software developer. XTM is an extended windows task manager and performance monitoring tool for Microsoft Windows 2000 OS and later versions of Windows. XTM can give fast solutions for sudden problems which may arise in a product's functioning without having to either reinstall it from the user workstation or even without needing to close the application.
http://www.yaodownload.com/utilites/system-utilities/extended-task-manager/

null-a 10. June 2006, 17:18

well, previous versions of opera didn't have this 'problem'. it only started with version 9. until then it used to have a very small 'memory print'. (i'm not a developer, so technical jargon might be missemployed). Thx.

dbw 22. July 2007, 23:51

Using my linux installation of Opera, I have examined my my ram usage. I've noticed that each cycle of opening and closing Opera increases the total amount of memory being used. This usage persists, even over night. This means I often have 200-300mb of spurious memory usage which is only corrected by a hard reboot. Any suggestions?

mitchman2 24. July 2007, 15:17

That sounds like the dynamic memory cache might be filling up. You don't say what version of Opera you use, though.

DontGoHere 18. August 2007, 03:24

So on average, does Opera use less memory than Firefox?

mitchman2 20. August 2007, 22:40

I haven't done any measurement myself, but it seems to be the common conclusion, yes.

ebulfin 14. December 2007, 11:57

This all sounds great, and the explanation is a fair comment on how the memory is calculated, but how come Opera is using more memory on my XP Pro set-up, than any other program, and carries on using (or hogging) that memory even after closing opera. It remains in my Task Manager as the largest single user of memory, yet I have closed Opera.

Sorry to have just repeated myself, but I explained this to someone else and the first E-mail back suggested I close Opera and reopened it ............ Been there, done that and got the tee shirt.

The next question back from support was about the version, so here is my set-up:
Version information
Version: 9.24
Build: 8816
Platform: Win32
System: Windows XP
Java: Sun Java Runtime Environment version 1.6
XHTML+Voice; IBM Multimodal Runtime Environment, Version: 4.1.3, Build: 20050506.01.1

mitchman2 17. December 2007, 14:02

Try setting the memory cache to a fixed value instead of automatic in Tools->Preferences->Advanced->History.

naveen_reloaded 30. December 2007, 09:02

may be i am totally out of topic ..
but why does the memory usage keeps on increasing with the hour os usage??

cmawhorter 22. January 2008, 11:16

I love opera. It is the superior browser (for me) by far. I arrived at your page after noticing Opera routinely used ~500MB of memory (working+private).

Thank you for the tip in the comments to change the memory cache setting. I changed it from automatic to 60MB, the largest available. Opera is now holding steady at ~250MB. I don't mind as long as I know where the memory is going. For comparison Firefox is usually the same or higher.

Thanks for the post. BTW... using opera 9.25

sbruce45 30. May 2008, 12:33

This discussion has been a real eyes-opener for me and the heavy usage of memory by Opera. Thanks.

moserw 17. July 2008, 17:40

mitchman2,

Thanks for pointing out to Tools->Preferences->Advanced->History. I had forgotten about it and Opera was going real slow on my system. Now I have optimized the settings and its a breeze as before. Much appreciated.

rsriv 26. November 2008, 04:04

You guys are all talking about memory usage, but what is surprising for me is the CPU resources Opera hogs on closing (98-99%). Moreover this persists for a substantial time slowing down all other applications running on the machine. CPU usage also shoots up after some time while browsing, and things get so slow that I cannot even change tabs - Opera just freezes for a couple of minutes.

While I am a dedicated Opera user since version 4.0, this new problem (for me since version 9.5) is giving me second thoughts.

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.