Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-01-2024, 04:46 AM   #1
hayaku
Member
hayaku began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2023
Device: Kindle
Memory Leak? (v2.31)

Hello.

I must admit, I wouldn't have expected that my RTX4090 would ram out running, Sigil, but it seems to be the case with v2.31

Click image for larger version

Name:	memory.png
Views:	101
Size:	30.6 KB
ID:	211148

Is this memory leak documented, with a fix on the way?

Sometimes, I've come back home to find Sigil consuming >20GB of VRAM. Quite concerning!

Thanks for this app, keep up the good work everybody!

Last edited by DiapDealer; 10-01-2024 at 07:12 AM. Reason: Thumbnail oversized theme-breaking image
hayaku is offline   Reply With Quote
Old 10-01-2024, 07:49 AM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It's always possible. A successful Windows QtWebEngine compilation nearly always has warnings of potential memory leaks. But the Qt used with Sigil 2.3.1 is the same one used with Sigil 2.3.0, so I would expect identical results. Any info on just how long Sigil had to stay running to get to the numbers you screen capped?

For the record... Sigil almost never needs very much GPU for rendering epubs. That's why we added the ability to turn off WebEngine's hardware acceleration in Sigil's preferences: to handle the edge cases where WebEngine doesn't always play nice with certain video cards. Have you tried disabling that?

Last edited by DiapDealer; 10-01-2024 at 10:27 AM.
DiapDealer is offline   Reply With Quote
Advert
Old 10-01-2024, 08:49 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not one to leave programs open and running for days at a time, but I'll leave Sigil running to see if I can duplicate your results. So far, my dedicated gpu memory is fluctuating between 0 and around 7,000K. But it's early. I'll keep checking.
DiapDealer is offline   Reply With Quote
Old 10-01-2024, 10:32 AM   #4
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
There is a bug posted to Qt about memory consumption with some AMD processors. I do not have a link handy but there are known issues.

I think I found the Qt bug report:

https://bugreports.qt.io/browse/QTBUG-125747

Using the --disable-gpu flag seemed to fix things. This did not happen with Intel.

Last edited by KevinH; 10-01-2024 at 10:37 AM.
KevinH is offline   Reply With Quote
Old 10-01-2024, 11:02 AM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm testing on an AMD processor at home right now. But I'm away from it, so I'll have to report back later.

On the Intel laptop (integrated GPU) that I'm also testing on, all memory usage increases with use, but seems to settle back down to numbers that match what it launched with after some idle time. So no net increase that I've been able to find so far.
DiapDealer is offline   Reply With Quote
Advert
Old 10-01-2024, 02:13 PM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It's not exactly the same as the OP's experience, but I'm seeing some strange results even on my Intel laptop with integrated GPU. When showing my shared GPU memory usage, I can make it steadily increase by simply minimizing and restoring Sigil over and over again. I got it up over a gigabyte and while it eventually went down a little, it never fully recovered (not even close).

This is all with the empty, default Sigil epub.

When I check the "Disable GPU Acceleration in QtWebEngine (in Sigil preferences), this behavior stops completely. The shared GPU memory usage stays nearly constant no matter how much minimizing and restoring I do.

Regular RAM usage stays fairly constant regardless of all of this.

Last edited by DiapDealer; 10-01-2024 at 04:42 PM.
DiapDealer is offline   Reply With Quote
Old 10-01-2024, 03:51 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
This is exactly what happened with the macOS memory leak Qt fixed earlier (but the fix was only for Apple Metal graphics). There was even a qml example program that opened a QtWebEngine WebEngineView and just constantly resized it, and you could watch the memory use just grow.

I will see if I can find the qml sample program and Qt bug.

Update: See https://bugreports.qt.io/browse/QTBUG-124353

In that issue is a bug.qml test case that you can run with the command:

qml bug.qml

and just watch the memory consumption grow due to huge memory leak. On arm64 mac the gpu and main memory s shared and you can see the gpu memory just grow.

It was fixed for MacOS in qt 6.7 with a patch.

Perhaps something similar is happening on Windows or Linux.

Last edited by KevinH; 10-01-2024 at 04:04 PM.
KevinH is offline   Reply With Quote
Old 10-02-2024, 04:49 AM   #8
hayaku
Member
hayaku began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2023
Device: Kindle
Hello all, thanks for the replies & interest!

Processor is an AMD 7950X in case anybody is wondering, or if that makes any difference.

It's hard to say how long I've left Sigil open to get this issue, but would be in the order of 24–48h.

I work within Sigil as my main text editing/writing platform (call me a masochist, but I really love it). So it stays open by default, 24/7 unless I need to restart my computer for any kind of reason.

@KevinH thanks for the additional info!
hayaku is offline   Reply With Quote
Old 10-02-2024, 10:12 AM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Are you able to determine if turning off QtWebEngine's hardware acceleration in Sigil's preferences eliminates the problem or not?
DiapDealer is offline   Reply With Quote
Old 10-02-2024, 11:11 AM   #10
hayaku
Member
hayaku began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2023
Device: Kindle
Ok, now we are up to 24 GB of VRAM used, only since this morning!

I've just disabled GPU Acceleration, but I switched it straight back on again. Taking it off made Sigil run like garbage, clunky like you wouldn't believe





Attached Thumbnails
Click image for larger version

Name:	sigil.png
Views:	258
Size:	4.8 KB
ID:	211159  
hayaku is offline   Reply With Quote
Old 10-02-2024, 11:35 AM   #11
hayaku
Member
hayaku began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Nov 2023
Device: Kindle
OK, I just did some experimenting.

I was able to get Sigil to go from about ~200MB of Memory use, up to >50 GB of memory use, in about 30 seconds.

All I had to do was grab the boundary for the "Preview Window" and resize it about 20 times, through click-and-drag.

Obviously, this would have maxed out my 4090, and then spilled over into my RAM to get this high.

Whose responsibility is this? Can we make a bug report and have it patched by the same people who fixed the Mac version, as already indicated?




Attached Thumbnails
Click image for larger version

Name:	sigil2.png
Views:	261
Size:	16.2 KB
ID:	211160  
hayaku is offline   Reply With Quote
Old 10-02-2024, 11:42 AM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by hayaku View Post
I've just disabled GPU Acceleration, but I switched it straight back on again. Taking it off made Sigil run like garbage, clunky like you wouldn't believe
That makes no sense to me. I've never noticed any performance difference whatsoever when disabling hardware acceleration for QtWebEngine in Sigil's preferences. No hardware acceleration is needed for rendering epubs with Sigil. The only thing disabling it could possibly affect in terms of performance is the Preview Window. And as mentioned, I've never witnessed any performance hit in that regard.

Something is very strange here if disabling that setting on modern hardware is affecting Sigil's overall performance.

Why is Sigil is using dedicated GPU RAM on your machine in the first place? It shouldn't need any of your GPU. Do you have something installed that forces programs to use dedicated GPU Ram? I've only ever seen Sigil use shared GPU Ram (with integrated GPUs).

Your Sigil experience is unlike any I've seen myself, or heard from other users.

Last edited by DiapDealer; 10-02-2024 at 11:46 AM.
DiapDealer is offline   Reply With Quote
Old 10-02-2024, 12:13 PM   #13
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,039
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Are you testing with Sigil's default empty epub, or an epub of your own? I'm asking because I'm trying to determine if the epub itself might not exacerbating the issue. Giant epubs (especially ones with very long/giant xhtml files with tons of images) can cause Sigil performance issues in general.

In all of my testing (on about four different machines--one of which has an AMD processor), I've noticed a bit of memory increase when minimizing/restoring, or resizing Preview/Sigil, but nothing that approaches the levels you're seeing. It takes me forever to get memory usage increased to 1Gb. And in all cases, disabling hardware acceleration for QtWebEninge in Sigil's preferences stops the problem completely (after restarting Sigil). With no noticeable performance loss. But I also don't edit/create/open epubs that I know will cause performance issues for Sigil. That might be the difference.

Last edited by DiapDealer; 10-02-2024 at 12:38 PM.
DiapDealer is offline   Reply With Quote
Old 10-02-2024, 12:50 PM   #14
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
That bug.qml testcase in the second Qt bugreport I cited, is a good way to test for memory leakage due to resizing a QWebEngineView.

That said, if only your machine displays this strange behaviour, it is more than likely the bug is in your gpu video driver, not Qt. A Qt bug would happen on all platforms using that architecture.

Also, I agree with DiapDealer, if you are seeing a serious slowdown after disabling the gpu in Sigil Preferences and then restarting Sigil, then something specific to your system/driver setup is indeed broken. Sigil does not really make much use of the gpu for an epub (ie. it is not a video game).
KevinH is offline   Reply With Quote
Old 10-03-2024, 12:09 AM   #15
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,449
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what it may be worth, on my Windows 11 machine with an Nvidia T1000 8GB video card, when I have GPU acceleration enabled, I do see the increase in memory usage when repeatedly closing and opening Sigil's Preview window. With GPU acceleration turned off, Sigil still seems to use 44MB of dedicated GPU memory. Opening the preview window jumps that to 48MB temporarily after which I see the memory use jumping between 0 and 44MB before settling back to 44MB. OTOH, I do not see a noticeable difference in screen draw speed whether or not I have GPU acceleration enabled.
DNSB is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak? d351r3d Sigil 5 01-16-2020 10:50 PM
Memory leak in calibre-server? mondai Calibre 6 06-24-2014 12:54 PM
Memory leak in 0.8.28? kongzifan Calibre 6 12-02-2011 10:46 AM
Memory leak? jhay777 Calibre 45 10-06-2011 11:18 AM


All times are GMT -4. The time now is 09:22 PM.


MobileRead.com is a privately owned, operated and funded community.