0.96.1: Possible memory leak with huge PNG file

*** Please report new bugs here! ***

Moderators: helmut, XnTriq, xnview, Dreamer

Post Reply
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

0.96.1: Possible memory leak with huge PNG file

Post 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:
Image
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post by xnview »

yes please send me a sample file
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post by xnview »

I've tried, XnView process takes 3gb to create thumbnail, but no problem on my PC
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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.
Attachments
Crashdumps.zip
(75.82 KiB) Downloaded 33 times
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post by xnview »

if you disable settings>General>Icc, same crash?
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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:
Image

Disabling ICC stops XnViewMP from crashing at least, but the thumbnail looks strange:
Image
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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?
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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:
Image
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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?
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post by Ezatoka »

It's this way around:
ICC enabled:
Image
XnViewMP tries to create the Thumbnail but it crashes during that
Image

ICC disabled:
Image
XnViewMP creates a thumbnail with wrong colors (no matter which color inherent setting used), but does NOT crash
Image


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.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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'?
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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:
Image
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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:
Image
this setting is quality of thumbnails stored in catalog
Pierre.
Ezatoka
Posts: 12
Joined: Wed May 06, 2020 2:08 pm

Re: 0.96.1: Possible memory leak with huge PNG file

Post 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.
Post Reply