Memory leak

For talk and Help about everything concerning TV-Browser.
Antworten
Del

Memory leak

Beitrag von Del »

Debug Info:

Code: Alles auswählen

System: Linux 4.2.0-1-amd64 amd64 UTF-8
Java: OpenJDK Runtime Environment 1.7.0_85 /usr/lib/jvm/java-7-openjdk-amd64/jre
TV-Browser: 3.4.1a /usr/share/tvbrowser
User settings: /usr/share/tvbrowser en GB Europe/London
LookAndFeel: javax.swing.plaf.nimbus.NimbusLookAndFeel
Plastic-Theme: com.jgoodies.looks.plastic.theme.SkyBlue
Persona: No Persona
Icons: icons/CrystalClear.zip
Info-Icons: tvb_colored.zip
Number of markings: 1161

Installed plugins:
  java.clipboardplugin.ClipboardPlugin true
  java.clockplugin.ClockPlugin true
  java.autoscrolltonowplugin.AutoScrollToNowPlugin true
  java.newsplugin.NewsPlugin true

Subscribed channels:
  BBC1 radiotimesdataservice
  BBC2 radiotimesdataservice
  ITV Yorkshire+1 radiotimesdataservice
  Channel 4 radiotimesdataservice
  Channel 5 radiotimesdataservice
  BBC3 radiotimesdataservice
  BBC4 radiotimesdataservice
  Dave radiotimesdataservice
  ITV2 radiotimesdataservice
  ITV3 radiotimesdataservice
  Yesterday radiotimesdataservice
  ITV4 radiotimesdataservice
  E4 radiotimesdataservice
  Eurosport radiotimesdataservice
  British Eurosport 2 radiotimesdataservice
  BT Sport//ESPN radiotimesdataservice
  Sky Sports F1 radiotimesdataservice

Data available:
  Thu, Oct 8 true
  Fri, Oct 9 true
  Sat, Oct 10 true
  Sun, Oct 11 true
  Mon, Oct 12 true
  Tue, Oct 13 true
  Wed, Oct 14 true
  Thu, Oct 15 true
  Fri, Oct 16 true
  Sat, Oct 17 true
  Sun, Oct 18 true
  Mon, Oct 19 true
  Tue, Oct 20 true
  Wed, Oct 21 true
  Thu, Oct 22 true
  Fri, Oct 23 false
  Sat, Oct 24 false
  Sun, Oct 25 false
  Mon, Oct 26 false
  Tue, Oct 27 false
  Wed, Oct 28 false
  Thu, Oct 29 false
  Fri, Oct 30 false
  Sat, Oct 31 false
  Sun, Nov 1 false
  Mon, Nov 2 false
  Tue, Nov 3 false
  Wed, Nov 4 false
  Thu, Nov 5 false
OS: Debian Testing

Hi,
This is really just a bug report/FYI.

I'm experiencing a serious memory leak when using tv browser. Starting programs from the terminal results in the error

Code: Alles auswählen

Gdk-WARNING **: shmget failed: error 28 (No space left on device)
or

Code: Alles auswählen

shmget: No space left on device

Code: Alles auswählen

# more /proc/sys/kernel/shmmni 
4096
# wc -l /proc/sysvipc/shm
4097 /proc/sysvipc/shm
I found the PID of the culprit in /proc/sysvipc/shm (4971 in this case) and

Code: Alles auswählen

ps -p 4971
reveals that Java is the culprit and

Code: Alles auswählen

ps aux|grep java
shows that Java is only running TV Browser.

I really don't know what more info I can give so please ask if more is needed.
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: Memory leak

Beitrag von Sheldon2012 »

Hi,

if you receive an error message like "No space left on device" I assume that the disk (device) you run TV-Browser on is full.
Did you check this?

Kind regards,

Sheldon
Del

Re: Memory leak

Beitrag von Del »

Yes, I did check (it was the first thing I did)

Code: Alles auswählen

free -gh
              total        used        free      shared  buff/cache   available
Mem:           3.3G        985M        1.4G         13M        930M        2.3G
Swap:          3.7G          0B        3.7G

I apologize for not giving this obvious piece of info.

(FYI, this is an error about memory not hard drive space).
Sheldon2012
Plugin-Developer
Beiträge: 1206
Registriert: 25 Dez 2012, 07:35

Re: Memory leak

Beitrag von Sheldon2012 »

But the message tells us that you run out of space on your device not out of memory.
Del

Re: Memory leak

Beitrag von Del »

shm = Shared Memory and is a virtual filesystem that exists in RAM. For example the directory /tmp/ exists in memory but can be written and read as if it exists on the hard drive. Remember that in Linux everything is a file (with Alsa you could pipe the raw data from a pertition on the hard drive through the speakers with the following command: cat /dev/sda1 > /dev/snd)

If I knew more about this subject I might be able to tell you why the errors use the word "device" but I'm afraid my knowledge of the kernel and system programming isn't good enough.

As you will notice the memory isn't being eaten up by Java or TV Browser but the vast majority of SHM id's (of which there are only 4096) have been used by Java (or TV Browser).

The following is the head of the virtual file /proc/sysvipc/shm:

Code: Alles auswählen

key      shmid perms                  size  cpid  lpid nattch   uid   gid  cuid  cgid      atime      dtime      ctime                   rss                  swap
         0          0  1600                393216  1541  1764      2  1000  1000  1000  1000 1444402300 1444402300 1444402293                393216                     0
         0      98305  1600                393216  1607  1173      2  1000  1000  1000  1000 1444402297          0 1444402297                393216                     0
         0     196610  1600                393216  1668  1173      2  1000  1000  1000  1000 1444402297          0 1444402297                393216                     0
         0     229379  1600                393216  1607  1173      2  1000  1000  1000  1000 1444402297          0 1444402297                380928                     0
         0     393220  1600                393216  1668  1173      2  1000  1000  1000  1000 1444402299          0 1444402299                 90112                     0
         0     557061  1600                393216  1651  5697      2  1000  1000  1000  1000 1444411523 1444411523 1444402299                253952                     0
         0     720902  1600                393216  1708  1173      2  1000  1000  1000  1000 1444402299          0 1444402299                 90112                     0
         0     819207  1600                393216  1716  1173      2  1000  1000  1000  1000 1444402299          0 1444402299                282624                     0
         0     851976  1600                524288  1612  4944      2  1000  1000  1000  1000 1444406065 1444406065 1444402300                196608                     0
         0  276496393  1600                524288  1741  1173      2  1000  1000  1000  1000 1444412868          0 1444412868                  4096                     0
         0  138149898  1600                126192  4971  4971      1  1000  1000  1000  1000 1444406070 1444406070 1444406070                     0                     0
         0  276234251  1600                524288  1659  1173      2  1000  1000  1000  1000 1444412509          0 1444412508                 32768                     0
         0    1736716  1600                393216  2926  5339      2  1000  1000  1000  1000 1444408584 1444408584 1444402575                393216                     0
         0    1835021  1600                393216  2926  5339      2  1000  1000  1000  1000 1444408584 1444408584 1444402575                245760                     0
         0    1867790  1600                393216  1612  4944      2  1000  1000  1000  1000 1444406065 1444406065 1444402576                196608                     0
         0    1900559  1600                393216  2944  2966      2  1000  1000  1000  1000 1444402579 1444402579 1444402579                196608                     0
         0    1998864  1600                393216  2944  1173      2  1000  1000  1000  1000 1444402579          0 1444402579                327680                     0
         0  274202641  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444409280 1444409280 1444409280                     0                     0
         0  138182674  1600                126192  4971  4971      1  1000  1000  1000  1000 1444406070 1444406070 1444406070                     0                     0
         0  138215443  1600                 33984  4971  4971      1  1000  1000  1000  1000 1444406070 1444406070 1444406070                     0                     0
         0  138248212  1600                130272  4971  4971      1  1000  1000  1000  1000 1444406070 1444406070 1444406070                     0                     0
         0  138280981  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406070 1444406070 1444406070                     0                     0
         0  138313750  1600                 82800  4971  4971      1  1000  1000  1000  1000 1444406070 1444406070 1444406070                     0                     0
         0  138346519  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138379288  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138412057  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138444826  1600                 29760  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138477595  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138510364  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138543133  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138575902  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138608671  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138641440  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138674209  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138706978  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138739747  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138772516  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138805285  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138838054  1600               4978848  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
         0  138870823  1600                 12672  4971  4971      1  1000  1000  1000  1000 1444406071 1444406071 1444406071                     0                     0
CPID and LPID mean Create Process ID and Last Process ID. As you can see the PID 4971 is repeated many times (4079 times, in fact).

While writing this I wonder if it is actually a problem with Java... TV Browser is the only reason I have Java installed though. I need something to test it on.
Hadmut
Newbie
Beiträge: 2
Registriert: 01 Nov 2015, 11:12

Re: Memory leak

Beitrag von Hadmut »

Hi,

I also experienced that problem and found that tvbrowser occupies more than 4000 shared memory segments, thus keeping other programs from running.

Seen on 3.4.1a and Ubuntu 15.10.
ds10
Site Admin
Beiträge: 19095
Registriert: 23 Jun 2005, 12:36
Kontaktdaten:

Re: Memory leak

Beitrag von ds10 »

Don't bother to post it here. TV-Browser is a Java application, therefor it does not handle the memory. All memory handling is done by Java and because of that TV-Browser has absolutely no control how that is done. Of course the used memory is caused by TV-Browser but that is not the problem here.
"First they ignore you, then they ridicule you, then they fight you, then you win." - Mahatma Gandhi
Unterstütze die Weiterentwicklung von TV-Browser
Del

Re: Memory leak

Beitrag von Del »

Hadmut hat geschrieben:Hi,

I also experienced that problem and found that tvbrowser occupies more than 4000 shared memory segments, thus keeping other programs from running.

Seen on 3.4.1a and Ubuntu 15.10.
I have to assume that you use openjdk too. The problem has been solved with the latest update and everything is working well.

Code: Alles auswählen

$ java -version
java version "1.7.0_91"
OpenJDK Runtime Environment (IcedTea 2.6.2) (7u91-2.6.2-1)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
Antworten