Page 1 of 1
0.96.1: Possible memory leak with huge PNG file
Posted: Wed May 06, 2020 2:41 pm
by Ezatoka
I'm running XnView MP Windows Version 0.96.1 64bits (Apr 19 2020) on Windows 10 Professional Version 1909 (Build 18363.535)
I have several, self stitched, huge PNG file which always causes XNView MP to crash upon trying to generate a thumbnail. They all roughly share the same dimensions of 23040x35200 pixel (some are 36480 in width).
On a few of them XNView MP creates a mostly black thumbnail with barely visible lines of the original images. On others (those involving alpha channel) the program just crashes upon trying to create a thumbnail. On the other files with black thumbnail it crashes as well after a moment when I click onto them to see them on the preview panel. The crash always happens, even if I open a directory with the single image from the start (like via context menu on the directory)
As the memory consumption of XNView MP goes up to around 3.5 Gigabytes of RAM before it crashes, I assume, that would be the problem.
If needed I can provide such a file without problem. It has a filesize of 432 MB which I can upload onto my own webspace.
For comparison and clarification: Windows Explorer creates a thumbnail within 3 to 5 seconds and showing the correct image contents. There is no thumbnail embedded in the file, so Windows had to read it from the (NVME) disk. I see Windows using the dllhost.exe with a call to thumbcache.dll to do this.
IrfanView also open the file just fine, it just needs some seconds. Image details are these then:

Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Sat May 09, 2020 12:04 pm
by xnview
yes please send me a sample file
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Sat May 09, 2020 3:17 pm
by Ezatoka
File URL sent via PM.
The PNG file was once optimized using pngcrush, I am not sure if this would be of any useful information.
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Sun May 10, 2020 1:37 pm
by xnview
I've tried, XnView process takes 3gb to create thumbnail, but no problem on my PC
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Sun May 10, 2020 1:48 pm
by Ezatoka
For me it crashes always when I try it. And each time it creates a crash dump in my temp folder.
I attached the two dump files of the two tries I just made. Can't read them though, I hope you can.
Can the rest of my computer specifications can be a problem?
CPU: AMD Ryzen 9 3900X
RAM: 32 GB DDR4 3600
GPU: NVidia GTX 980
I tried to make XnViewMP only use one thread of my CPU (via Process Explorer), but it still crashed.
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Mon May 11, 2020 12:25 pm
by xnview
if you disable settings>General>Icc, same crash?
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Mon May 11, 2020 12:53 pm
by Ezatoka
I downloaded XnView Portable 2.49.2 and this doesn't have a problem at all generating the thumbnail with nearly not noticable memory consumption:
Disabling ICC stops XnViewMP from crashing at least, but the thumbnail looks strange:

Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Mon May 11, 2020 3:34 pm
by xnview
Ezatoka wrote: Mon May 11, 2020 12:53 pm
I downloaded XnView Portable 2.49.2 and this doesn't have a problem at all generating the thumbnail with nearly not noticable memory consumption:
settings>General>Icc is disabled?
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Mon May 11, 2020 3:44 pm
by Ezatoka
The setting doesn't seem to matter.
The ICC was disabled at the beginning, but even after I put the color profile, which makes XnViewMP crash, into any field, the portable XNView still works flawlessly:

Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Thu May 14, 2020 7:46 am
by xnview
Ezatoka wrote: Mon May 11, 2020 3:44 pm
The ICC was disabled at the beginning, but even after I put the color profile, which makes XnViewMP crash, into any field, the portable XNView still works flawlessly:
Is it 'ICC profile' that crash XnView? With this setting disabled, you have the crash, right?
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Thu May 14, 2020 1:55 pm
by Ezatoka
It's this way around:
ICC enabled:

XnViewMP tries to create the Thumbnail but it crashes during that
ICC disabled:

XnViewMP creates a thumbnail with wrong colors (no matter which color inherent setting used), but does NOT crash
XnView Portable 2.49.2
always creates the thumbnail and
never crashes. It doesn't matter if I disable ICC, enable ICC and set the icc file from my monitor or use any of the possible color inherent setting.
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Thu May 14, 2020 2:47 pm
by xnview
Ezatoka wrote: Thu May 14, 2020 1:55 pm
XnView Portable 2.49.2
always creates the thumbnail and
never crashes. It doesn't matter if I disable ICC, enable ICC and set the icc file from my monitor or use any of the possible color inherent setting.
XnView Classic doesn't use ICC profile for thumbnail.
Do you have same settings between Classic&MP, 'Create high quality thumbnail', 'use alpha channel'?
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Thu May 14, 2020 3:12 pm
by Ezatoka
Woah... unchecking "Create high quality thumbnail" does the trick in all ways.
The thumbnail is created quickly, the memory consumption is low and most important: it doesn't crash! Even with "Use alpha channel" checked.
But what does this option do? When I can set up the quality of the thumbnails somewhere else:

Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Thu May 14, 2020 3:17 pm
by xnview
Ezatoka wrote: Thu May 14, 2020 3:12 pm
Woah... unchecking "Create high quality thumbnail" does the trick in all ways.
The thumbnail is created quickly, the memory consumption is low and most important: it doesn't crash! Even with "Use alpha channel" checked.
the resize method is different
But what does this option do? When I can set up the quality of the thumbnails somewhere else:
this setting is quality of thumbnails stored in catalog
Re: 0.96.1: Possible memory leak with huge PNG file
Posted: Thu May 14, 2020 3:21 pm
by Ezatoka
Alright, then I will just untick "Create high quality thumbnail" and then my problem should be solved. I'm kinda sure it doesn't matter if the thumbnail is a high quality or "regular" quality one. It will do it's purpose to show a smaller way of the image.
From my side this could be closed then, as you can't reproduce the error on your site it seems.