[LH4317] Is Beta 36 SUPPOSED to use almost 3 GBs of RAM?

A few hundred, sure.

2.9 GBs?

Holy moly.

In anticipation of obvious questions, yes it’s a big project, but roughly the same size it’s been through the last several versions. I haven’t worked on it since Thanksgiving. Last time I checked, Scrivener was using a few hundred MBs. Nothing on this end changed except for the recent update.

And I’m not sure as of which version the huge memory gulp occurred. Maybe v36 or v35?

Hogs get slaughtered.png

How long did you have it open for? It’s about 350-400MB for me at the moment, and doesn’t seem to be changing much.

Have you been going into and out of Scrivenings mode? This looks like that. Every time you go into Scrivenings mode, RAM consumption doubles (at the very least). Unfortunately, it is not released when you exit Scrivenings mode. In 1.9.x, you see the same jump in memory usage when entering Scrivenings mode, then (when you exit Scrivenings mode) it drops back down. That is the way it should work, but it would seem the memory is allocated but not released for Scrivenings mode in the beta. It’s been this way for a while now - others have commented on it, as have I.

Most of the day, but not as long as usual. I often go 12-14 hours (not necessarily writing all that time, lol.)

I closed it awhile and just started it up to check. A bit over 200 MB now, which is what I’m used to.

2.9 GB was scary.

I always work in this mode. I keep forgetting the terminology, but isn’t this “Scrivenings” mode?

Switching back and forth between the bulletin board and this mode didn’t increase memory, but your idea led me to the culprit.

Every time I click on a folder in the Binder, memory jumps. More for large folders, less for smaller ones, but ALWAYS UP. As you can see from this one, I got it up to 2.3 GB before I got tired of clicking.


So maybe the “can’t create backup” problem is related to this ever-more-bloated memory problem?

Memory usage doesn’t bump if I click on a document, no matter where it is, whether inside the current folder or in another folder. Only when I click on another folder itself.

Well, it created a backup just fine after bumping the memory usage up over 2.3 GB, so maybe the problems aren’t related, unless there’s some limit I hit when mem usage was up to 2.9 GB…

Yes, when you select a folder you’re going into Scrivenings mode. In the screenshot, you’ve got the Scrivenings mode button selected in your toolbar.

What “can’t create backup” problem?


Well I guess your language threw me. I never leave Scrivener mode (almost, and thanks for confirming that’s what that is,) so when I click on a folder I’m not “going into” it – I’m already in it.

I consider this a serious memory management problem.

This one: [url][BUG] v35 refuses to create backup on close]

OK…so I got a larger project, loaded the entire thing in Scrivenings mode It jumped to 1.4GB. Then I selected an individual file, and it’s still 1.4GB used. Is this normal behavior? I selected an individual file, not in Scrivenings mode, and it’s still 1.4GB. I’d expect the RAM usage to go down, when things aren’t being loaded? Or does it keep everything in memory, and a large project is just going to use a lot?

I guess what I’m wondering is: while the RAM usage doesn’t go up over time, it’s not being cleared, either. How often does Scrivener do garbage collection?

Every time I load the project in Scrivenings, the number keeps going up. (At 2.3GB after 3 changes to Scrivenings mode and back.) I’m not making changes to the file, either.

Here’s the project in question, which is allegedly too large for an attachment. (It’s my recipe file, so have at.) dropbox.com/s/u7e11ed2diezq … D.zip?dl=0

Yes, that is scrivenings mode. I rarely use scrivenings mode, preferring instead to work using the binder and individual scenes/documents. As was mentioned in this thread: [url]https://forum.literatureandlatte.com/t/lh4317-36-memory-leak/48719/1], this is a pretty serious memory usage problem. There have been zero comments from the devs so far. Fire up version 1.9.x to see how it is supposed to work. I’m assuming that the memory will continue going up and up until everything is consumed, at which the computer may become sluggish and/or unresponsive as Windows starts trying to use the hard disk to swap RAM. Anything else running (or attempting to run) may encounter delays or fail for random reasons simply because there is no available RAM.

Yeah, something seems up. I would expect it to release those files that are stored in memory when not in Scrivenings mode. Or at least do garbage collection more often, since it seems to reload everything into RAM every time Scrivenings mode is used without freeing any old files.

When garbage collection happens is usually up to the .NET framework. Are you seeing this on a Windows machine or on a Linux machine running WINE? If the latter, that could indicate an issue with WINE and it would be interesting to duplicate on a Windows box.

Me, WINE. I thought it was interesting that it was the same behavior that was reported by a Windows user, too. Or a couple.

We managed to pinpoint the memory leak and a fix will be available in the next update. Thanks for reporting this guys!

As someone who reported this back in November, I’m glad to hear a fix is coming soon. Look forward to testing the beta out more thoroughly now that I will be able to run it without fear of breaking Windows. :slight_smile:

Thanks to fellow-users for their detective work; much appreciated.

Woohoo. Memory leaks can be nasty to chase down.

Awesome! Thanks Tiho for the update.

A quick test, but this seems to be fixed! YAY! Beta 38.

It went from 385MB, to 900ish, then back to 580MB when I switched out of Scrivenings mode. Is it still keeping some of the other files loaded? I’d expect it to go back to 385 or so? But it’s not exponentially doubling every time you switch in and out of Scrivening mode, so that’s a definite plus. :slight_smile: