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

Ma
MalignantCarp
Posts: 27
Joined: Thu Feb 17, 2011 6:42 am
Platform: Windows

Sun Nov 03, 2019 11:24 pm Post

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?
Author cancels write; interrupted by carp.


Windows 10 Pro 64-bit, 32GB RAM, AMD Ryzen 5 3600X 6-core 3.8GHz

Ma
MalignantCarp
Posts: 27
Joined: Thu Feb 17, 2011 6:42 am
Platform: Windows

Fri Nov 15, 2019 4:10 am Post

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.
Author cancels write; interrupted by carp.


Windows 10 Pro 64-bit, 32GB RAM, AMD Ryzen 5 3600X 6-core 3.8GHz

St
SteveCarterFrogstory
Posts: 73
Joined: Fri Feb 22, 2013 7:35 pm
Platform: Windows

Sat Dec 21, 2019 5:58 pm Post

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.

gj
gjperch
Posts: 18
Joined: Tue Nov 12, 2013 1:45 pm
Platform: Windows

Sat Dec 21, 2019 11:50 pm Post

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.

User avatar
Jestar
Posts: 168
Joined: Sun Feb 19, 2017 6:51 pm
Platform: Mac + Windows

Sun Dec 22, 2019 7:39 pm Post

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")
4-Start scrivenings mode.png
Scrivenings start
4-Start scrivenings mode.png (62.56 KiB) Viewed 586 times

5) Seconds later, scrivenings mode displays and Scrivener back to being usable - mem = 2,041,984 KB
5-Scrivenings mode functional.png
Scrivenings mode functional
5-Scrivenings mode functional.png (60.02 KiB) Viewed 586 times

6) Moved files from Research folder to trash, then closed project - mem = 1,996,904 KB
6-Moved to trash and closed project.png
Trashed and closed project
6-Moved to trash and closed project.png (60 KiB) Viewed 586 times

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.
Win 10 Ent. 64-Bit 1909
Intel Core i7-2600 @ 3,4 GHz (Quadcore) 32 GB RAM
Samsung SSD 860 EVO 500GB
NVIDIA Quadro K600
Scrivener Version: Version: 1.9.16.0 - 14 Nov 2019 & Version: 2.9.0.44 Beta (876128) 64-bit - 26 Mar 2020

User avatar
narrsd
Posts: 702
Joined: Wed Sep 22, 2010 8:34 pm
Platform: Win + iOS

Tue Dec 24, 2019 7:00 pm Post

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!

User avatar
Jestar
Posts: 168
Joined: Sun Feb 19, 2017 6:51 pm
Platform: Mac + Windows

Wed Dec 25, 2019 12:29 am Post

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.
Win 10 Ent. 64-Bit 1909
Intel Core i7-2600 @ 3,4 GHz (Quadcore) 32 GB RAM
Samsung SSD 860 EVO 500GB
NVIDIA Quadro K600
Scrivener Version: Version: 1.9.16.0 - 14 Nov 2019 & Version: 2.9.0.44 Beta (876128) 64-bit - 26 Mar 2020

th
thePhilosoraptor
Posts: 1258
Joined: Sat Feb 13, 2016 3:28 am
Platform: Windows

Mon Feb 24, 2020 12:54 am Post

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

Thanks!
Bryan Bender

User avatar
Jestar
Posts: 168
Joined: Sun Feb 19, 2017 6:51 pm
Platform: Mac + Windows

Mon Feb 24, 2020 4:01 am Post

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

Thanks!

This appears to have resolved in B39.
Thanks!
Win 10 Ent. 64-Bit 1909
Intel Core i7-2600 @ 3,4 GHz (Quadcore) 32 GB RAM
Samsung SSD 860 EVO 500GB
NVIDIA Quadro K600
Scrivener Version: Version: 1.9.16.0 - 14 Nov 2019 & Version: 2.9.0.44 Beta (876128) 64-bit - 26 Mar 2020