Kalagaar / tabgroupsmanager

Automatically exported from code.google.com/p/tabgroupsmanager
0 stars 0 forks source link

Out of memory when saving session #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have hundreds of tabs in tens of groups. Usually this makes no problem. But 
occasionaly, Firefox signals an out-of-memory error despite the fact that there 
are still lots of free memory in the system. Once I start getting this error, 
it doesn't solve itself and I have to restart (kill) the Firefox. The error 
occurs (only?) on both automatic (timer, on exit) and manual session saves by 
TGM.

The error reads:

  NS_ERROR_XPC_JS_THREW_STRING
  'out of memory' when calling method: [nsISessionStore::getBrowserState]

  File: undefined
  Line: 869
  Stack:
   undefined

I suspect that this error occurs only when I browse the documentation on IBM 
sites, like 
http://pic.dhe.ibm.com/infocenter/idm/v2r2/index.jsp?topic=%2Fcom.ibm.db2tools.f
peic.doc.ug%2Ffpeic282.html. These pages consume extreme amount of memory and 
CPU, so there may be some other problems with them too. But this is just an 
observation, it may not be correct.

System Info:
TGM 2013.07.07.002
32-bit Firefox 24 on Windows 7 x64
lots of addons, including the following tab-related addons: Multiple Tab 
Handler, Suspend Background Tabs, Tab Scope, TabGroups Menu. But with older 
versions of FF and TGM this was happening too (though I am not sure that the 
error message was exactly the same).

Currently the error is occuring, but FF is still usable and works without any 
other problem. FF takes 3.3GB RAM, the system has still 1GB of free physical 
memory (and 7GB of free virtual memory).

Original issue reported on code.google.com by x...@zoznam.sk on 15 Oct 2013 at 9:35

GoogleCodeExporter commented 9 years ago
I can confirm this error on TGM 2011.11.28.1 (orginal TGM with some fixes to 
work for Fx nightly). I see this error after long sessions without FX restart, 
if i use the hibernate mode of OS over several days. I have not observed a 
special website in this relation.

Original comment by micha.go...@arcor.de on 15 Oct 2013 at 8:41

GoogleCodeExporter commented 9 years ago
I frequently get the exact same problem with the same message. It usually 
happens after browsing for a few hours without a Firefox restart. It usually 
happens when I have at least 3-4 groups with at least 70-80 tabs open. I 
probably have 30+ hibernated groups as well (unsure if this consumes any 
working memory). It seems to be able to happen while on any site. Sometimes it 
coincides with the graphics beginning to screw up (blank black screen for a 
while with stuff usually returning when moving the mouse over them, etc). My 
RAM is most often not even near any critical level of usage when this happens. 
I'm no expert for sure, but seems like some bug/flaw/leak etc to me.   

Original comment by fredrikr...@gmail.com on 13 Nov 2013 at 1:15

GoogleCodeExporter commented 9 years ago
This has been happening to me on (almost) every timer save for over a month 
now.  The symptoms include the creation of a truncated saved 
backup_data_timer*.tgm2 file which aborts or crashes on attempted session load. 
 Usually this file is 239KB or 16,533KB when a correct full save is around 
27,049KB.

After a browser (Firefox 25.01) restart (and reloading recent tabs from History 
==> Show All History ==> Today) TGM will (sometimes) save a full backup*.TGM2 
file a few times before beginning to save truncated ones.  It never recovers 
after that and crashes several hours later.

Note:  Increasing the about:config times for
dom.max_chrome_script_run_time
dom.max_script_run_time
seemed to help for a while but now increasing them even more no longer works.

p.s.:  I love this extension when it works!

Original comment by patrick....@gmail.com on 27 Nov 2013 at 12:53

GoogleCodeExporter commented 9 years ago
I think these memory errors occur when I have a loaded tab that has an embedded 
video.  If a tab with an embedded video is not (yet) loaded, there is no 
problem.  This happens a lot when FF crashes and restarts, and many tabs are 
not loaded until you either click on them, reload them, or close another tab 
making the tab in question the current tab.  If such a reloaded tab has an 
embedded video, then the next attempt at a "TGM: Backup session" seems to 
result in such a memory error.

You can clear this by reloading Firefox (or rebooting the whole computer), or 
by removing every loaded tab that has an embedded video.  I am not sure if this 
applies to all kinds of embedded videos, or only certain ones.

Shortly after I restarted Firefox, I experimented and opened a link that had an 
embedded video.  After I watched the video, I hit the little white star in a 
blue field (TGM: Backup Session), and, sure enough, I got 
"NC_ERROR_XPC_JS_THREW_STRING".  I then closed that tab, hit it again, and 
everything seemed OK.

I plan to conduct further experiments, and I would like others to do so.  Maybe 
we can "crowdsource" a solution to this problem.

Original comment by MagLe...@gmail.com on 24 Dec 2013 at 2:23

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Minor correction:  This occurs when I'm in my regular "User", with about 50 
windows and several hundred tabs in Firefox.  When I switched to an alternate 
user on the same computer, with only three windows and seven tabs, this did not 
occur.  Memory was even tighter on the Alternate User because the Regular User 
was still loaded.  Maybe you need both a large number of tabs, and the presence 
of embedded videos on loaded tabs.

Original comment by MagLe...@gmail.com on 24 Dec 2013 at 2:59

GoogleCodeExporter commented 9 years ago
I did some testing.  Apparently, not all videos cause this problem.  I tried 
three YouTube videos, with no problem:

Chiron Beta Prime: http://www.youtube.com/watch?v=B3DyxaCYlfg

There is no Sanity Clause:  http://www.youtube.com/watch?v=G_Sy6oiJbEk

Highway of the Future:  http://www.youtube.com/watch?v=5CVN3qKQoxc

Also, I had no trouble with www.WeirdUniverse.net/, even though it has several 
embedded videos.

However, a couple of pages with embedded videos did give me the problem:

http://evworld.com/focus.cfm?cid=194

http://bathroomreader.com/author/admin/page/29/

Closing the pages resolved the problem.  Anybody have any ideas as to what 
makes the difference?

Original comment by MagLe...@gmail.com on 25 Dec 2013 at 4:45

GoogleCodeExporter commented 9 years ago
This also seems to happen to me without (loaded) tabs with videos.

Original comment by alexey.v...@gmail.com on 27 Dec 2013 at 7:59

GoogleCodeExporter commented 9 years ago
Yes, this also happens without loaded tabs that have embedded videos.  It may 
merely be related to how much memory loaded tabs are using.

Original comment by patrick....@gmail.com on 29 Dec 2013 at 3:14

GoogleCodeExporter commented 9 years ago
Maybe that's it -- embedded videos take up a lot of memory, and the more of 
them there are, the more memory is used, and the more likely the memory fault 
will occur.

I have tried to close tabs with embedded videos as soon as I view the video, 
and that has been partially successful, in that it has delayed the onset of the 
memory fault, but not eliminated it.  Sometimes I test it, and the memory fault 
occurs while the tab is loaded, and disappears after I close it.  So, it is 
"reversible".

Further research, and further ideas, are needed.  Thank you both.

Original comment by MagLe...@gmail.com on 29 Dec 2013 at 4:21

GoogleCodeExporter commented 9 years ago
I played around with this some more.  Using Windows Task Manager, you can tell 
how much memory is used by FF.  See the attached file.  Sort by decreasing 
memory.  If Firefox is using more memory than anything else, then it will 
always appear on top.

I found it very hard to reduce the memory that FF was using.  I rebooted, and 
was disappointed that the memory fault still occurred, and Firefox was using 
approx. 2,200,000 K.  I closed about forty tabs, and got it down to about 
2,030,000 K -- and the memory problem disappeared.  Sadly, after I did a couple 
of other things, it reared its ugly head again, and FF memory usage was about 
2,300,000 K.

This suggests that the "Magic Number" is 2 Gibabytes = 2,097,152 K = 
2,147,483,648 bytes, as I seem to get the problem if FF is using more than that 
amount of memory, and not so if it less.  This suggests that some program is 
using a 32-bit signed integer when it should be using a 64-bit unsigned integer.

This just illustrates that, as with any investigation, there are some false 
leads, and there are some leads that, although they aren't quite spot-on, lead 
to the true cause.  Any comments?

Original comment by MagLe...@gmail.com on 30 Dec 2013 at 5:39

Attachments:

GoogleCodeExporter commented 9 years ago
I had FF's memory usage down to 2,039,928 K, and tried to backup the session, 
and it stilled failed!  Closer examination revealed that, as I was backing up, 
the memory surged to about 2,180,000 K for a moment.  It flashed by so fast I 
could barely see it.

I'm going to close more tabs and get things "clean", and see if the problem 
goes away.

Original comment by MagLe...@gmail.com on 30 Dec 2013 at 11:43

GoogleCodeExporter commented 9 years ago
Just read, and closed, about 40 more tabs, and then rebooted.  So far, no 
memory errors, even tho FF is taking about 2,300,000 K.  But, I must have very 
few tabs with embedded videos.  Maybe the <iframe tab is doing it??

Original comment by MagLe...@gmail.com on 31 Dec 2013 at 3:27

GoogleCodeExporter commented 9 years ago
My thrill was short-lived.  I move around some tabs, and the memory error 
returned.  All this time, FF was using 2,2000,000 K to 2,550,000 K.  Why the 
change?  What gives?

Original comment by MagLe...@gmail.com on 31 Dec 2013 at 3:57

GoogleCodeExporter commented 9 years ago
This issue is almost certainly not due to Firefox's private allocations 
exceeding 2GB. In order to actually run out of address space, the Firefox 
process's total usermode memory usage, including shareable memory not counted 
by the Windows Task Manager, would have to exceed either 3GB (limit for 
LARGEADDRESSAWARE 32-bit apps on 32-bit Windows) or 4GB (limit for 
LARGEADDRESSAWARE 32-bit apps on 64-bit Windows).

More likely, Firefox is running into some internal limitation of its own 
memory-management techniques. For example, it may need to allocate a large 
block of contiguous memory, but be unable to find such a block because its 
address space has become fragmented and Firefox is not able to relocate 
existing allocations to make space. Basically, Firefox is not actually running 
out of memory - so it's not the exact number that's triggering the problem - 
but it's running low enough on memory that it needs more intelligent management 
in order to make use of the space that it has.

Original comment by JMoon5...@gmail.com on 31 Dec 2013 at 10:40

GoogleCodeExporter commented 9 years ago
Suspect this memory failure is more related to sessionstore processing. We need 
a 100% re-produceable way to debug this. Sadly this memory errors happens 
always if there is no time to investigate it...

Original comment by micha.go...@arcor.de on 31 Dec 2013 at 4:02

GoogleCodeExporter commented 9 years ago
This looks interesting: https://bugzilla.mozilla.org/show_bug.cgi?id=581510
Seems not to be a problem of TGM.

Original comment by micha.go...@arcor.de on 31 Dec 2013 at 4:42

GoogleCodeExporter commented 9 years ago
That may explain why embedded videos tend to trigger this error.  They probably 
need large blocks of contiguous memory.

At times, I've been able to successfully back up a session, and then load a tab 
with an embedded video, see the session-save fail, and then close that tab, and 
it works again.  But, other times, it fails no matter what I do.  I'll worry 
about this next year.

Original comment by MagLe...@gmail.com on 1 Jan 2014 at 2:22

GoogleCodeExporter commented 9 years ago
It is I, again.

What I have often tried to do is to reduce FF's memory footprint by closing or 
hibernating a tab groups, or to prepare for reducing the memory by moving tabs 
or tab groups.  I would then immediately do a manual "TGM: Backup Session", and 
often would be faced this the pernicious memory fault.

I now find that, by monitoring the "Processes" tab on Windows Task Manager, the 
memory that FF uses has a surge whenever any of those operations are performed. 
 If one waits about twenty or thirty seconds, the surge will subside, and then 
it will be safe to save the session.

Original comment by MagLe...@gmail.com on 16 Jan 2014 at 11:15

GoogleCodeExporter commented 9 years ago
Confirm, I have this issue too. Can't save session even after memory free up.

Original comment by i@soar.name on 16 Jan 2014 at 4:09

Attachments:

GoogleCodeExporter commented 9 years ago
hi everyone - same sort of problem here. FF v28, win7 64bit ultimate; 32gb RAM, 
256SSD, i7 3930K, etc...I am nowhere near using my available memory - 4 to 6gb 
RAM is typical usage for me out of my 32gb and get this error but also have 
many tabs with embedded video on UNLOADED pages/tabs as well.  Without taking a 
week to selectively troubleshoot which video/media/script on which tab is 
causing this, has anyone gotten any closer to a definitive answer to this 
problem?  I have only just encountered this upon upgrading to FF27 and 28.  
most addons I use are the same I have used for years (with appropriate updates 
to them as well as java, flash, windows etc).  I am all up to date and have 
tried reinstalling FF, session manager and so forth to no resolution...help?? :)

Original comment by darkestr...@gmail.com on 19 Apr 2014 at 10:21

Attachments:

GoogleCodeExporter commented 9 years ago
Try to change the value 
"extensions.{1280606b-2510-4fe0-97ef-9b5a22eafe30}.max_file_write_size" in 
about:config from 20 to 500.

Original comment by da...@o2.pl on 5 May 2014 at 9:45

GoogleCodeExporter commented 9 years ago
The above method doesn't work..

FF 29

Original comment by a29988...@gmail.com on 8 May 2014 at 7:43

GoogleCodeExporter commented 9 years ago
I get this issue both with the old official version and with the one offered 
here. Running Firefox 29.0.1 under WinXP 32bits SP3.

I used to think the issue was related to using Memory Fox, but recently i've 
started to get that error dialog with everything "undefined" when saving 
sessions even if i leave Memory Fox disabled.

Original comment by TiagoTia...@gmail.com on 19 May 2014 at 9:04