Memory being Gobbled up by Embedded Video

Non release banter
Post Reply
Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Memory being Gobbled up by Embedded Video

Post#1 by Bogomips » 15 May 2015, 22:50

About 10 minutes into playing an embedded video, using flash plugin, sometimes find around 50% available memory gobbled up, starting from an initial:

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
aufs            265M  8.9M  256M   4% /
Would be grateful for any hints as to how I can find which file is being written to so that I can then magic folder the directory of that file.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
brokenman
Site Admin
Site Admin
Posts: 5460
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Memory being Gobbled up by Embedded Video

Post#2 by brokenman » 16 May 2015, 00:46

Could it be the flash video being cached in your home directory? The location depends on which browser you are using. You might find it like so:

Code: Select all

find ~/.config -type f | xargs file |grep Flash
For firefox try:

Code: Select all

find ~/.mozilla/firefox/*.default/Cache -type f -exec file {} \;  | grep Flash
Try opening another console while playing the video and typing: lsof | grep Flash
This should give you a path to any cached file where a link has ben removed but the flashplayer plugin keeps a handle open to use the file. It won't be visible in any file list but the plugin can still use it.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Memory being Gobbled up by Embedded Video

Post#3 by Bogomips » 17 May 2015, 00:48

brokenman wrote:Could it be the flash video being cached in your home directory? The location depends on which browser you are using.
That was what I suspected. Am using PaleMoon, and am pretty sure of having moved its cache to a real filesystem.

Code: Select all

find ~/.config -type f | xargs file |grep Flash
guest@porteus:~$ find ~/.config -type f | xargs file |grep Flash
Nothing.
brokenman wrote:Try opening another console while playing the video and typing: lsof | grep Flash
This should give you a path to any cached file where a link has ben removed but the flashplayer plugin keeps a handle open to use the file.

Code: Select all

guest@porteus:~$ lsof | grep Flash
plugin-co 9798      guest   13u  unknown                              /tmp/FlashXXlRLPAg (deleted) (stat: Stale NFS file handle)
guest@porteus:~$ file /tmp/FlashXXlRLPAg
/tmp/FlashXXlRLPAg: ERROR: cannot open `/tmp/FlashXXlRLPAg' (No such file or directory)
Have also looked into .adobe and .macromedia. Previously looked at changes, but without success, because I suspect that no change is recorded while a file is being written to. :Search:

Had looked previously at lsof -o or -s option, but had then not given it a try. Might bear looking into.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Memory being Gobbled up by Embedded Video

Post#4 by Bogomips » 18 May 2015, 00:40

Tried lsof -s followed by lsof -o, while video was playing:

Code: Select all

guest@porteus:~$ r=10; echo Sampling at Interval of $r Secs; awk -v t=$r '/^o0t/ {y=substr($0,4); if (y+0>z+0) {z=y; getline; f=$0;  print z,substr(f,2)}} /^m/ {print $0,"Elapsed Time="t*m++" secs"} END{print z,substr(f,2)}' < <(lsof +D $HOME -F no -o -o 0 -r$r)
Sampling at Interval of 10 Secs
71834 /home/guest/.xsession-errors
m Elapsed Time=0 secs
m Elapsed Time=10 secs
m Elapsed Time=20 secs
m Elapsed Time=30 secs
m Elapsed Time=40 secs
m Elapsed Time=50 secs
m Elapsed Time=60 secs
m Elapsed Time=70 secs
m Elapsed Time=80 secs
m Elapsed Time=90 secs
m Elapsed Time=100 secs
m Elapsed Time=110 secs
m Elapsed Time=120 secs
m Elapsed Time=130 secs
^C
Trying next /tmp:
guest@porteus:~$ r=10; echo Sampling at Interval of $r Secs; awk -v t=$r '/^o0t/ {y=substr($0,4); if (y+0>z+0) {z=y; getline; f=$0;  print z,substr(f,2)}} /^m/ {print $0,"Elapsed Time="t*m++" secs"} END{print z,substr(f,2)}' < <(lsof +D /tmp -F no -o -o 0 -r$r)
Sampling at Interval of 10 Secs
m Elapsed Time=0 secs
m Elapsed Time=10 secs
m Elapsed Time=20 secs
m Elapsed Time=30 secs
m Elapsed Time=40 secs
^C
Finally top level:
guest@porteus:~$ r=10; echo Sampling at Interval of $r Secs; awk -v t=$r '/^o0t/ {y=substr($0,4); if (y+0>z+0) {z=y; getline; f=$0;  print z,substr(f,2)}} /^m/ {print $0,"Elapsed Time="t*m++" secs"} END{print z,substr(f,2)}' < <(lsof +D / -F no -o -o 0 -r$r)
Sampling at Interval of 10 Secs
lsof: WARNING: can't opendir(/etc/sudoers.d): Permission denied
lsof: WARNING: can't opendir(/var/db/sudo): Permission denied
lsof: WARNING: can't opendir(/var/log/setup/tmp): Permission denied
lsof: WARNING: can't opendir(/var/run/udisks): Permission denied
lsof: WARNING: can't opendir(/var/cache/ldconfig): Permission denied
lsof: WARNING: can't opendir(/root): Permission denied
71834 /home/guest/.xsession-errors
m Elapsed Time=0 secs
m Elapsed Time=10 secs
m Elapsed Time=20 secs
^C
Looks like there are no open files in the MB range. So, one is left wondering if a malloc could affect the amount of space available in aufs.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
phhpro
Full of knowledge
Full of knowledge
Posts: 545
Joined: 10 Nov 2013, 20:35
Distribution: .

Re: Memory being Gobbled up by Embedded Video

Post#5 by phhpro » 20 May 2015, 20:22

...
Last edited by phhpro on 04 Feb 2016, 03:03, edited 1 time in total.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Memory being Gobbled up by Embedded Video

Post#6 by Bogomips » 21 May 2015, 22:52

phhpro wrote:Does this happen with PM only?
Think also had it with SeaMonkey. Seems to be a Mozilla thing. Couldn't check SeaMonkey, because 2.33.1 bombs out. Up to 2.32 crashed on Mint, but now 2.33.1 ok on Mint.
phhpro wrote:Source of the clip? Same results with any clip, or just this one?
vodlocker.com. Any clip, and seems to be any embed. Also on vk.com, etc.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
phhpro
Full of knowledge
Full of knowledge
Posts: 545
Joined: 10 Nov 2013, 20:35
Distribution: .

Re: Memory being Gobbled up by Embedded Video

Post#7 by phhpro » 23 May 2015, 03:55

...
Last edited by phhpro on 04 Feb 2016, 03:03, edited 1 time in total.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Memory being Gobbled up by Embedded Video

Post#8 by Bogomips » 23 May 2015, 13:37

phhpro wrote:Other sites OK?
dropvideo.com gulps it down. vk.com also had some of this effect.

dropvideo.com: Starting from

Code: Select all

guest@porteus:~$ df -h .
Filesystem      Size  Used Avail Use% Mounted on
aufs            265M  8.8M  256M   4% /
reached 50% usage in just

Code: Select all

guest@porteus:~$ time watch -d -n1 df -h .

real    1m56.014s
user    0m0.937s
sys     0m0.418s
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

tome
Contributor
Contributor
Posts: 562
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: Memory being Gobbled up by Embedded Video

Post#9 by tome » 23 May 2015, 20:24

Maybe this:

Code: Select all

du -haxt 10M /mnt/live/memory/images/changes

Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Memory being Gobbled up by Embedded Video

Post#10 by Bogomips » 23 May 2015, 20:53

Tried changes before, but nice set of options. So at 20% aufs usage:

Code: Select all

guest@porteus:~$ du -haxt 10M /mnt/live/memory/images/changes
du: cannot access ‘/mnt/live/memory/images/changes’: No such file or directory
The reason for this, I had speculated, was that no changes are recorded until a file is actually closed. Hence the excursion into lofs. :) Or maybe no changes are recorded if running AF with just rootcopy?
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

tome
Contributor
Contributor
Posts: 562
Joined: 26 Jun 2013, 14:03
Distribution: x64 Openbox
Location: Poland
Contact:

Re: Memory being Gobbled up by Embedded Video

Post#11 by tome » 23 May 2015, 21:09

Sorry, path should be ‘/mnt/live/memory/changes' if I good remember now.

Bogomips
Full of knowledge
Full of knowledge
Posts: 2548
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: Memory being Gobbled up by Embedded Video

Post#12 by Bogomips » 24 May 2015, 20:01

Code: Select all

guest@porteus:~$ du -haxt 10M /mnt/live/memory/changes
16M     /mnt/live/memory/changes

Every 10.0s: df -h .                                                Sun May 24 20:57:25 2015

Filesystem      Size  Used Avail Use% Mounted on
aufs            265M  103M  162M  39% /
real    0m2.616s
user    0m0.012s
sys     0m0.025s
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Post Reply