Last Comment Bug 369002 - config.trim_on_minimize does nothing on Vista/Win7
: config.trim_on_minimize does nothing on Vista/Win7
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: Trunk
: x86 Windows Vista
: -- normal with 2 votes (vote)
: ---
Assigned To: Jim Mathies [:jimm]
:
Mentors:
: 420267 454058 (view as bug list)
Depends on:
Blocks: 352420 582027 660367 382984 420267 526862
  Show dependency treegraph
 
Reported: 2007-02-01 11:54 PST by Carsten Book [:Tomcat] - PTO-back Sept 4th
Modified: 2011-05-27 18:14 PDT (History)
12 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
change (2.47 KB, patch)
2011-05-26 14:22 PDT, Jim Mathies [:jimm]
tellrob: review+
Details | Diff | Splinter Review
updated patch (2.03 KB, patch)
2011-05-27 09:39 PDT, Jim Mathies [:jimm]
no flags Details | Diff | Splinter Review

Description Carsten Book [:Tomcat] - PTO-back Sept 4th 2007-02-01 11:54:24 PST
Setting Config.trim_on_minimize (http://kb.mozillazine.org/Config.trim_on_minimize) to true saves a lot of RAM in Windows 2000 - XP. On Vista this pref seems to be broken because in my case it saves only 2kb.

STR:
Use XP, W2k, W2k3 
-Create in about:config Config.trim_on_minimize and set this pref to true
-Restart firefox
-Open the Taskmanger
-Minimize Firefox and Memory usage goes down

Do the same steps on Vista and you see no effect on minimize
Comment 1 Bruno 'Aqualon' Escherl 2007-02-01 12:05:28 PST
This doesn't work for me under Windows XP. I used Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/2006120418 Firefox/2.0.0.1 to test it.
Comment 2 WADA 2007-11-20 22:48:01 PST
(In reply to comment #0)
> -Minimize Firefox and Memory usage goes down
> Do the same steps on Vista and you see no effect on minimize

To Carsten Book(bug opener):
Are you talking about number displayed in "Memory Usage" column for "Image Name=firefox.exe" row at "Process" tab of MS Win's "Task Manager"?
Comment 3 James Ross 2007-11-21 13:29:31 PST
I'm pretty sure the reporter is talking about "Memory Usage", or "Working Set" as it is better-labeled in Vista's Task Manager.

It's also a misnomer that this is saving any memory at all. The default behaviour (false) actually overrides the normal behaviour of the OS, to its detriment, but when set to true the OS will manage Firefox's memory the same as any other app. It is therefore normal and expected to be different on different versions of the OS, even on different machines, and I really don't think you can call this a bug.
Comment 4 erpman1 2007-11-26 13:45:26 PST
(In reply to comment #1)
> This doesn't work for me under Windows XP. I used Mozilla/5.0 (Windows; U;
> Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/2006120418 Firefox/2.0.0.1 to test it.
> 

The "config.trim_on_minimize" setting should work under Windows XP.  However, it should NOT be called "Config.trim_on_minimize" but instead called "config.trim_on_minimize".  BE CAREFUL!  The "c" for config should be lowercase, NOT uppercase for it to work under Win2k/XP/2k3.
Comment 5 erpman1 2007-11-26 13:50:08 PST
(In reply to comment #0)
> Setting Config.trim_on_minimize
> (http://kb.mozillazine.org/Config.trim_on_minimize) to true saves a lot of RAM
> in Windows 2000 - XP. On Vista this pref seems to be broken because in my case
> it saves only 2kb.
> 
> STR:
> Use XP, W2k, W2k3 
> -Create in about:config Config.trim_on_minimize and set this pref to true
> -Restart firefox
> -Open the Taskmanger
> -Minimize Firefox and Memory usage goes down
> 
> Do the same steps on Vista and you see no effect on minimize
> 

Hey Carsten.  I have tested "config.trim_on_minimize" under a Vista Home Basic laptop computer recently and you're right.  Minimizing FF in Vista with "config.trim_on_minimize" set to "true" does nothing to reduce memory usage.
Comment 6 WADA 2007-11-26 18:07:52 PST
(In reply to comment #0)
> -Minimize Firefox and Memory usage goes down
> Do the same steps on Vista and you see no effect on minimize

Misleading label of "Memory Usage" looks to be improved to "Working Set" by Vista. (similar label to name in Performance Counter)

To Carsten Book(bug opener):

Read following document pointed by Bug 381950 Comment #0 for "page trimming" of MS Win(NT or later), please. 
> "Windows NT page replacement policies"
> http://www.demandtech.com/Resources/Papers/WinMemMgmt.pdf

Some Web pages say "such actions on Vista are executed each 5 minutes in background". Will "10 or 20 minutes of minimize of Fx/Tb/Sm window" invoke "page triming" action by Vista? Will number displayed in "Working Set" column become smaller(than before minimize) after 10 or 20 minutes?
Comment 7 Jesse Ruderman 2008-09-07 11:10:31 PDT
*** Bug 454058 has been marked as a duplicate of this bug. ***
Comment 8 fuckyoubitches 2011-04-20 04:10:20 PDT Comment hidden (abusive)
Comment 9 Jim Mathies [:jimm] 2011-05-24 07:04:48 PDT
FYI, I'm planning on disabling this by default for Vista and up (or maybe in all cases after some testing) in 7.0. This "feature" has been the source of numerous bugs over the years, and was originally designed to address something on 2K. I think it's time we finally turn it off in cases where it has little to no effect.
Comment 10 Jim Mathies [:jimm] 2011-05-26 14:10:28 PDT
I've been doing a little testing on memory starved images. So far I've found that the setting does as advertised on XP - w/'TOM' disabled (default fx setting), the working set remains constant and there are few page faults when restoring the window. With the option enabled (default win behavior) I see the working set drop way down on minimization, and I also see some lagginess after restoring and scrolling a large page. When scrolling I also see the working set expand and the page faults spike. 

On Win7 though, I see none of this. The behavior is the same regardless of the setting. The working set on an image w/450mb of ram and 430 in use didn't page out anything when the app was minimized. Because of this when restoring the window, page faults were at a minimum and there was no lagginess.

So based on this, I think it would be safe to flip the setting to true by default on Vista and up.
Comment 11 Jim Mathies [:jimm] 2011-05-26 14:22:15 PDT
Created attachment 535472 [details] [diff] [review]
change
Comment 12 Rob Arnold [:robarnold] 2011-05-26 17:26:36 PDT
Comment on attachment 535472 [details] [diff] [review]
change

I'd rather just get rid of the whole trim on minimize feature, but this is at least some progress towards that. Don't suppose we could just ignore the pref for Vista/7?
Comment 13 Jim Mathies [:jimm] 2011-05-27 08:13:58 PDT
(In reply to comment #12)
> Comment on attachment 535472 [details] [diff] [review] [review]
> change
> 
> I'd rather just get rid of the whole trim on minimize feature, but this is
> at least some progress towards that. Don't suppose we could just ignore the
> pref for Vista/7?

There's no harm in keeping it around for a while. User's who have set this manually would likely have set it to true so I don't see a need to ignore it. After we get past XP (which according to wikipedia still enjoys around 40% market share) we can remove the code completely.
Comment 14 Jim Mathies [:jimm] 2011-05-27 09:39:55 PDT
Created attachment 535667 [details] [diff] [review]
updated patch

The util prefs work broke this, here's the updated patch w/some additional cleanup on the comments.
Comment 15 Jim Mathies [:jimm] 2011-05-27 15:37:08 PDT
http://hg.mozilla.org/mozilla-central/rev/3b2ad265faf1
Comment 16 Jim Mathies [:jimm] 2011-05-27 15:38:37 PDT
*** Bug 420267 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.