Menu

#84 Massive memory leaks

open
nobody
None
5
2011-07-11
2011-07-11
Anonymous
No

Hello all,
since a few months I've had a weird problem with xournal. Basically running xournal for some time will cause such a massive memory consumption (on documents with just one page, even!) that oom-killer goes ahead and makes other applications - or xournal - crash. To me it looks as if the memory is heavily fragmented. Attached you will find a sample output from dmesg after such a crash.

Okay, this crash could come from anywhere, and xournal isn't exactly showing high memory consumption. So why blame xournal? I got two reasons for this. The first and most important is that for the past half year I've had this problem, but *only* when running xournal. It hasn't appeared a single time when xournal was closed. And I use xournal very unregularily, it's not like it's open most of the time but I do use it 2-3 times a week still. And these crashes ONLY happen then.

Another reason is that when displaying memory consumption, e.g. using htop, xournal doesn't show much memory usage - but X does, it can really fill up my 2 GB of memory! When I close down xournal in time however, the memory consumption goes down to normal levels again. Closing any other applications doesn't result in that effect. So I'm pretty sure that this problem is caused by xournal. I can provide additional information if you tell me what to do.

I'm on Arch Linux, by the way. My WM is Xmonad, my graphics chip is Intel GMA 950 running the Intel driver. The Laptop is a Thinkpad X60 Tablet.

Discussion

  • Denis Auroux

    Denis Auroux - 2011-07-15

    Thanks for the report. My first impression is that it's most likely to be a bug in your X server, since it's the X server that is consuming a lot of memory. Xournal stress-tests the X server in different ways than almost any other application -- it processes a lot of tablet input events (and draws a lot of polygonal lines, but those don't consume X resources) -- so a memory leak in the wacom driver or in the input event processing code would not affect other applications.

    Because xournal doesn't talk to the X server directly (everything passes through the GTK+ libraries), the effects of the xournal code on X server memory allocation are at best remote, and hard to figure out directly. Considering that the issue doesn't seem to affect too many users, I'm

    My guess would be that your X server (or the linuxwacom driver) has a memory leak in input event processing. Did the problem appear upon upgrading your X server? (My recommendation would be to try switching to a different version of the X server and/or linuxwacom driver).

    Possible way to sort it out: does the memory leak happen only when you draw with the tablet pen or also if you draw with a mouse/trackpoint/... ? And does disabling "use xinput" in the options menu avoid the leak?
    In such cases, I'd say it confirms my suspicions that the X server (or the linuxwacom driver) leaks memory when handling input events from the tablet.

    Denis

     
  • Anonymous

    Anonymous - 2011-07-16

    Thank you for your reply. Unfortunately, disabling xinput doesn't solve the issue, so I suppose this might originate from somewhere else. A memory leak in X or linuxwacom could indded be the case; I'm currently unable to downgrade X, though.

    I never draw with a mouse/trackpoint and since the problem only appears after hours, this seems like too much time to put into testing this. ;) However, I wonder if your suspicions could still be true or can be seen as unlikely now since disabling xinput doesn't change the problem at all.

     
  • Anonymous

    Anonymous - 2011-07-16

    Just now I had a nice reproducable firefox crash caused by this problem. The actual memory usage wasn't high, as the attached screenshot shows. However, please not the *insane* virtual memory usage by the X server: 1451 MB! Starting firefox would result in it getting killed because of low memory within around ten second of browsing the web

    Closing any other programs didn't help, it stayed at this high memory consumption. Only when closing xournal, the "VIRT" memory of X immediately went down to around 170 MB, which I consider pretty normal.

    I don't really know what this "VIRT" value means. I'm not using a swap file, so it can't have anything to do with that. My guess is that for some reason, the memory that X uses is heavily fragmented and this fragmentation is only resolved when closing down xournal... no idea why this could be happening though.

     
  • Denis Auroux

    Denis Auroux - 2011-07-21

    Sorry, I'm really out of ideas on how to approach this... does anyone else have the same issue?
    Perhaps the upcoming Xournal++, based on different code, won't have this bug?
    In the meantime, you should consider saving and restarting xournal once in a while when in marathon notetaking sessions... Sorry for the inconvenience!

    Denis

     

Log in to post a comment.