0.86: Out of memory error

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

Moderators: xnview, Dreamer

Post Reply
wartisoc
Posts: 11
Joined: Sun Oct 16, 2016 3:53 am

0.86: Out of memory error

Post by wartisoc »

XnView: MP 0.86 - 64-bit
OS: Linux - 64-bit

Effect: Out of memory error on GIFs with lots of frames.

Not sure if this is a bug on XnView MP or in my Linux distro memory management, looking for confirmation.

I just downloaded the attached file and attempting to open it with XnView MP caused my machine to hang until, after a few minutes, the XnView MP process was killed making my machine responsive again. Checking the output of dmesg afterwards, I got this:

Code: Select all

[23111.612506] Out of memory: Kill process 8243 (XnView) score 649 or sacrifice child
[23111.612509] Killed process 8243 (XnView) total-vm:3850004kB, anon-rss:2816232kB, file-rss:3940kB
So, apparently XnView MP was attempting to allocate nearly 4 GB for this seemingly simple animation. The GIF image is 772x663 pixels and contains 1263 frames.

To reproduce:
1. Open the attached image.
Actual behaviour (bug): On my machine, XnView MP is killed with an Out of memory error after attempting to allocate nearly 4 GB of RAM :bug:

Expected behaviour: XnView MP to handle the file without attempting to allocate more RAM than available on the system, maybe?.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 47041
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: 0.86: Out of memory error

Post by xnview »

XnView loads all decompressed frames of GIF, so if you have a lot of frames, you can have a memory problem
Pierre.
wartisoc
Posts: 11
Joined: Sun Oct 16, 2016 3:53 am

Re: 0.86: Out of memory error

Post by wartisoc »

Oddly enough, if I open another image and then use Left/Right to go to the animated GIF, XnView plays it without issues. It is only when I select the GIF on the explorer window and open it that it brings my machine to its knees.

[EDIT:] Nevermid, XnView MP plays the GIF sometimes but other times it hangs. It seems just random.

I still think there must be a better way to handle these situations, maybe a setting to let the user set the maximum amount of RAM to use for images/animations so that XnView MP can display a message saying it can't open that image with the current settings instead of hanging. Casually browsing my images and getting a system hang whenever I randomly hit one file can be really annoying. While deleting/moving the problematic file can be a solution, it's hardly an elegant one.
Post Reply