Skip navigation.

exploreopera

| Help

Sign up | Help

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

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

By gun, # 6. March 2006, 18:23:47

avatar
Nice, really nice!!

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

By chesss, # 7. March 2006, 08:42:56

avatar
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").

By mitchman2, # 7. March 2006, 10:09:43

avatar
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?

By jp10558, # 7. March 2006, 15:51:10

avatar
Private Bytes is not included in the working set.

By mitchman2, # 7. March 2006, 18:02:13

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

By mitchman2, # 9. March 2006, 10:53:37

avatar
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?

By shogunu, # 11. March 2006, 18:29:59

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

By mitchman2, # 12. March 2006, 18:20:22

avatar
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

By chesss, # 13. March 2006, 21:49:30

avatar
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.

By chesss, # 13. March 2006, 22:02:40

avatar
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/

By tony2006, # 20. April 2006, 02:27:37

avatar
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.

By null-a, # 10. June 2006, 17:18:14

avatar
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?

By dbw, # 22. July 2007, 23:51:23

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

By mitchman2, # 24. July 2007, 15:17:07

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

By DontGoHere, # 18. August 2007, 03:24:48

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

By mitchman2, # 20. August 2007, 22:40:17

avatar
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

By ebulfin, # 14. December 2007, 11:57:57

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

By mitchman2, # 17. December 2007, 14:02:57

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

By naveen_reloaded, # 30. December 2007, 09:02:55

avatar
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

By cmawhorter, # 22. January 2008, 11:16:47

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

By sbruce45, # 30. May 2008, 12:33:12

avatar
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.

By moserw, # 17. July 2008, 17:40:44

Write a comment

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