Page 1 of 1

Memory being Gobbled up by Embedded Video

Posted: 15 May 2015, 22:50
by Bogomips
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.

Re: Memory being Gobbled up by Embedded Video

Posted: 16 May 2015, 00:46
by brokenman
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.

Re: Memory being Gobbled up by Embedded Video

Posted: 17 May 2015, 00:48
by Bogomips
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.

Re: Memory being Gobbled up by Embedded Video

Posted: 18 May 2015, 00:40
by Bogomips
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.

Re: Memory being Gobbled up by Embedded Video

Posted: 21 May 2015, 22:52
by Bogomips
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.

Re: Memory being Gobbled up by Embedded Video

Posted: 23 May 2015, 13:37
by Bogomips
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

Re: Memory being Gobbled up by Embedded Video

Posted: 23 May 2015, 20:24
by tome
Maybe this:

Code: Select all

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

Re: Memory being Gobbled up by Embedded Video

Posted: 23 May 2015, 20:53
by Bogomips
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?

Re: Memory being Gobbled up by Embedded Video

Posted: 23 May 2015, 21:09
by tome
Sorry, path should be ‘/mnt/live/memory/changes' if I good remember now.

Re: Memory being Gobbled up by Embedded Video

Posted: 24 May 2015, 20:01
by Bogomips

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