#941792 mediathekview: not enough memory for import of film list

#941792#5
Date:
2019-10-05 13:24:43 UTC
From:
To:
Dear Maintainer,

importing (updating) the filmlist fails every time (starting recently)
on my Thinkpad X280 (Intel i5-8250U, 8GB).

"top" reports a constant memory usage of around 1G and a utilisation
of almost 100% on each CPU core. Then, after some minutes, CPU
utilisation goes back to normal, memory usage still at around 1G, but
the filmlist hasn't been imported/updated.

Looking into /usr/bin/mediathekview I found the line:
run_java -Xms128M -Xmx1G -Djdk.gtk.version=2 -jar /usr/share/mediathekview/MediathekView.jar "$@"

Changing the -Xmx1G to -Xmx2G fixes the problem, so now the line reads:
run_java -Xms128M -Xmx2G -Djdk.gtk.version=2 -jar /usr/share/mediathekview/MediathekView.jar "$@"

(mediathekview now reports the memory usage with a maximum of around
1,75G, so I left it at 2G to be on the safe side)

Importing (updating) the filmlist now works fine (and fast) again.

As this is an amd64 installation I am not sure if this bug report is
related to bug #916341

Cheers

Armin

#941792#10
Date:
2019-10-18 20:08:55 UTC
From:
To:
Hi,

I am having similar trouble on sid, but increasing max heap does not
really solve it for me. Loading the list succeeds until around 30k
entries instead of 10k, but I also had to increase the number of tasks
for my user session¹ to 32k and Mediathekview still reports errors like
this:

[45,113s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached.
Exception in thread "UIFilmlistLoaderThread" java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits re$
ched

I sent signal 3 to the process and see thousands of threads like this
one:

"Cleaner-16991" #17039 daemon prio=8 os_prio=0 cpu=0,18ms elapsed=1,85s tid=0x00007f28f8c93000 nid=0x785d in Object.wait()  [0x00007f28986aa000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(java.base@11.0.5/Native Method)
        - waiting on <no object reference available>
        at java.lang.ref.ReferenceQueue.remove(java.base@11.0.5/ReferenceQueue.java:155)
        - waiting to re-lock in wait() <0x00000000c8d1ff80> (a java.lang.ref.ReferenceQueue$Lock)
        at jdk.internal.ref.CleanerImpl.run(java.base@11.0.5/CleanerImpl.java:148)
        at java.lang.Thread.run(java.base@11.0.5/Thread.java:834)
        at jdk.internal.misc.InnocuousThread.run(java.base@11.0.5/InnocuousThread.java:134)

Mediathekview is unusable in this state and I do not think I can solve
it with configuration changes. I did not find an issue in the upstream
bug tracker (on Github), but since we do not have the current version in
Debian I am hesitant to open a ticket.

Regards,
Jochen.

¹ cat /etc/systemd/system/user-1000.slice.d/resources.conf
  [Slice]
  TasksMax = 32768