[LH4317] Beta 27 Possible Memory Leak Issue (with steps to reproduce)

My first attempt at utilizing the beta involved importing a series of novellas, which quickly chewed up 5GB of RAM. The following are steps to reproduce similar behaviour:

  1. Create an MS Word .docx file. Add the Heading 1 “Lorem Ipsum” add in 10,000 words (Lorem Ipsum generator); copy this content, including the heading, 3 more times until your document reaches 40,008 words. Save that file and duplicate it 4 times so that you have 5 files.
  2. Import those 5 files simultaneously into a clean Scrivener project’s Research folder (I used a completely empty project, with just Draft, Research, and Trash).
  3. Keep an eye on your memory usage throughout. You will likely find that memory usage sky-rockets.
  4. Click on the Research folder and go into Scrivenings mode if you want to bloat your memory even further.
  5. Select them all and send them to the trash.
  6. Empty the trash.

When I start with the open project, I am sitting at 102,600K memory usage on my Win7x64 system.
Once all five test files have been loaded, that is up to 2,176,760K memory usage.
By the time the trash is empty, that’s up to 5,122,276K memory usage.

For comparison, the latest version of Scrivener 1 starts at 68,044K and ends at 79,460K, so not a huge difference from start of the procedure to finish.

Is anyone on Windows 8/8.1/10 able to reproduce with these steps?

Definitely seems to be a memory leak, still an issue with beta 29. Similar behaviour can be found just moving trough the Scrivener Tutorial. As each document is opened, memory usage increases; unlike Scrivener 1 for Windows, however, that memory usage does not seem to decrease.

For example: I opened up each document, including folders, in scrivenings mode in the tutorial, ending on the entire draft folder in scrivenings mode. That procedure brought me from 118MB memory usage up to 732MB. When I then selected a smaller document, no change in memory usage.

In Scrivener 1, the same procedure brought me from 57MB usage to 275MB usage, and then moving to a smaller document knocked memory usage back down to 81MB.

I will be getting my Windows 10 system running within the next week and will advise if it occurs there as well.

This issue is still present in Beta 32. I’m on Windows 7. I have a project with over 70k words total, over 70 documents under the Draft folder. If I select them all and view in Scrivenings mode, the memory usage jumps by several hundred MB. Navigating to a single document, then all document in Scrivenings mode a few times pushes the memory usage over 1GB. (I find it hard to understand the amount of memory used. The entire project file is only about 48MB.) I have to exit the application and reopen it to get the memory usage back down.

Ditto. Beta 32, Windows 10.

Each time I select my manuscript folder, memory jumps a couple hundred MB. My project is 1.5 MB in size with 24,000 words. Memory jumps every time I click a single project folder and then click the master manuscript folder. By doing this a half-dozen times, my memory usage is over 2GB.

Using Beta 32 x64, local file (no sync), Win 10 1909 x64, 32GB RAM, SSD, i7 CPU - following OP’s steps.

  1. Scrivener startup - no open projects - mem = 85,916 KB
  2. Create a blank project called mem-test - mem = 111,180 KB
  3. Created files and added to Research folder - mem = 141,772 KB (still no real leak or issues)
  4. Start scrivening mode on files in Research folder - mem = 1,855,484 KB (WOW! And have “Not Responding”)
  5. Seconds later, scrivenings mode displays and Scrivener back to being usable - mem = 2,041,984 KB
  6. Moved files from Research folder to trash, then closed project - mem = 1,996,904 KB

    It should be noted that that memory usage became the baseline for any new projects opened and only reverted to a state of less than 100,000 KB after I completely closed Scrivener and then restarted it. Scrivenings mode seems to be the issue here.

One more data point on this – simply took a Research section about the length of a short story, put it in Scrivenings mode, clicked on and off the Research folder a number of times.

Each Scrivenings mode click on the folder added circa 50MB to memory used by Scrivener, in the (all latest) Win10 Task Manager.

Closing a project with this activity (I had several open) didn’t give any of this added memory back.

In any case, Merry Christmas!

So I was working on a generic novel template for NaNoWriMo and noted some unusual behavior somewhat related to this. Scrivenings mode still exhibits the memory race as noted earlier, just not as dramatically, when entering it with 100 empty scenes selected - so it doesn’t matter if you are in the manuscript folder, research folder, or any combination of folders. The strangeness I noted was in the Outliner mode when working with meta-data. I found that it is easier (less wait time) to set up the meta-data with only one scene open in Outliner mode (which doesn’t display anything but the outline columns). My meta-data fields correspond to fields I will be using in Aeon Timeline, but Aeon was not a part of the setup of the template. Once the columns were set up, I selected a few scenes in the Binder to see how things looked in Outliner mode - no problems so far. Once I clicked on the single chapter that held the 100 blank scenes to display in Outliner mode (target set for each scene is 500 words, so 100x500=50,000), Scrivener immediately took up 12-15% of the CPU and became unresponsive for a few seconds - similar to what I was experiencing when trying to set up the columns when I had multiple scenes selected in Outliner mode. Making any changes to the columns (clicking them on/off or resizing a column) when all of the Chapter scenes were selected also resulted in the CPU race and unresponsiveness for a few seconds. Interestingly enough, if I select the Manuscript folder in the Binder (which includes the one chapter with 100 empty scene documents) there is no CPU spike or unresponsiveness and the columns can be clicked on/off, resized, and rearranged in real-time without any pauses. Selecting about 30 or more of the blank scenes gets the same CPU usage spike and unresponsiveness as if I selected the chapter with the scenes. Other than the CPU spike and unresponsiveness, the memory usage is negligible and returns to “normal” for whatever mode you change to except for Scrivenings mode.

This has been filed and should be fixed in the latest version. If you are still experiencing this please let us know.


This appears to have resolved in B39.