r/software • • May 15 '10

I ☹ Flash

http://www.flickr.com/photos/14296760@N00/4607685269/
2 Upvotes

28 comments sorted by

19

u/InTheFiveByFive May 15 '10

Silly post. Gentleman navigated to a web site where Flash buffered up a video on the page, then complained that it was taking a lot of memory 'even though it's not playing'.

12

u/myheaditches May 15 '10

There is not 2.2GB of video on that page.

3

u/Shambles May 15 '10

Not 2.2GB of video in the files themselves, but I'm under the impression (which may be incorrect) that Flash upconverts from the original file and then plays the viewable form from memory. Loading both of the files plus all of the data extrapolated from those files could plausibly take up 2 or 3 times the space.

This is pretty much educated guesswork though. I'm a CS student, but unfamiliar with Flash.

4

u/adzm May 15 '10

I am surprised that flash would put that much info in a memory buffer. Seems like using a cache file makes more sense; it is not like all that memory needs instant access. Then again, perhaps OSX has more aggressive virtual memory and swap/page file usage. I admit I am not really certain how that all works on that OS.

9

u/[deleted] May 15 '10

He should ☹ his mac because that trailer barely used over 250MB of ram for me in windows 7 and firefox.

Safari more than likely has a memory leak when dealing with flash.

Adobe wonders why people are down on Flash

Because they buy into Apple's marketing. Apple doesn't want flash on their platform because it would compete with iTunes and the app store, so they say it sucks and get mac users to hate flash so they don't want it.

Android will have flash and iPlatform won't, because it will cut into the money fountain of iTunes and App store. To keep people from wanting flash and jumping ship Apple fills the world with FUD about how bad flash is so people don't bail on Apple's walled in garden.

0

u/[deleted] May 15 '10

[deleted]

1

u/[deleted] May 15 '10

http://imgur.com/0wxO1.jpg

Well I suppose we can rule out: webkit, flash, the flash movie player being poorly coded.

that leaves: OSX, safari's interface for handling plugins, just safari in general, adobe's implementation in OSX.

Oh, but wait. Here is flash running in my virtual machine that only has 320MB of ram allocated.

http://imgur.com/nyaeA.png

Well, imagine that. I'm using shockwave flash 10.0 r45 too.

I guess that rules out: Adobe did a piss poor job of making flash for everything besides windows, flash only works well on windows.

I think the safest conclusion is that Safari and OSX just suck. And in case you were wondering, that video plays perfectly fine. OS is Ubuntu 9.10.

3

u/mxrider108 May 16 '10

This is not a good test at all--under any OS. Results depends on a lot of factors, such as what other applications you have running at the time or the total amount of free memory. Plus, seeing how much memory is used in Flash Player in Ubuntu has nothing to do with Flash Player on OS X. So, you can't rule out "adobe's implementation in OSX" and conclude "Safari and OSX just suck" even though your blind hatred wishes it were so.

-2

u/jonhohle May 15 '10
  1. Flash player should buffer… to disk, not resident memory

  2. Just browsing a site is consuming more than 50% of available memory pushing other apps into swap, degrading the performance of the entire system.

Adobe is trying to push this software to mobile devices, but its a resource hog on desktops. I'm just presenting another data point.

8

u/asshammer May 15 '10

Why would you want to write to disk on video that is most likely about to be played?

-4

u/jonhohle May 15 '10

Why would you want to decodenand store video in RAM if it is never played? Disk is still significantly cheaper and more plentiful than RAM.

7

u/the_hmm May 15 '10

and slow. Most people are watching these videos instantaneously. writing direct to a Disk would sacrifice the instant gratification you get with RAM. Yes, this is inefficient for mobile devices, so I'm not saying you're wrong. And not all of it does buffer to memory, there are significant cache files already in place for desktops. They just need to adapt flash to work with the limited resources in a mobile device.

1

u/jonhohle May 15 '10

disk is more than adequate for streaming video. Harddrives transfer data at 40-100MB/s. Bluray disks transfer data at 4.5MB per second, and have no problem playing video. The entire movie has no business being in RAM, ever.

0

u/Shambles May 15 '10

You're forgetting that constantly reading from the hard drive for the duration of playback introduces a serious performance bottleneck that would definitely affect any other running programs that require disk access. Playing from RAM only introduces real performance problems if it uses too much (which it often does, but being broken sometimes is better than being broken always).

1

u/jhaluska Helpful May 15 '10 edited May 15 '10

Hard drives are an order of magnitude or more slower than memory. Even a high end SSD have less than 1/10th the bandwidth of memory. Modern operating system will automatically cache out the memory to the hard disk when it runs out. That is when the system seems to crawl.

1

u/jonhohle May 15 '10

Of course RAM is faster than disk, and disk is still more than fast enough to stream HD video, which this is not. Do you think Bluray players or DVRs have 2+GB of RAM? And bluray players are reading from disks significantly slower than disk.

0

u/jhaluska Helpful May 16 '10

You're getting voted down (not by me) because your idea is just so technically poor.

It's not that you couldn't play back from hard disks, just there is no reason to write to disk when you have memory available. Even when you run out of memory, the OS keeps statistics on which memory is accessed at what frequency and swaps out to the disk memory that it thinks is not likely to be needed again soon. Preemptively writing to the disk at too high of a frequency would slow down the entire system, especially if something else needed to read and write to the "slow" hard drive.

2

u/jonhohle May 16 '10

I understand that the OS will swap out "inactive" applications, which is what happened when 55% of my RAM was used to not play a video, bringing everything else on the system to a halt, as it had to be swapped back in from slow disk. The problem was, these applications weren't inactive, they were just forced into swap because the system was under unnecessary memory pressure, caused by the unreasonable allocation of memory by Flash player.

Anyone who thinks its reasonable for a plugin to allocate 2.2GB of memory while visiting a web page is out of line. This isn't a gigantic game, a CAD application, some complex simulation, a media editing program; it's a web page with some video.

For people who think this is reasonable, take VLC for example. To play a 3.4GB, 1080i video, it uses 105MB of RAM. Flash player allocated 20x this for a significantly lower resolution, shorter videos. I can scrub to any point in the file without delay and no other programs are "slowed down" by VLC reading the file (maybe by VLC decoding the video, but not reading from disk). 105MB is reasonable considering two fields of uncompressed 1080i require about 6MB, assuming two I-frames are kept in RAM, a video buffer for upcoming frames, and an audio buffer. In this case 1080i requires 2MB/s from disk, whereas swapping will peg the disk, because the data was required already required in RAM, and wasn't available and needs to be loaded as quickly as possible. And when I stop the video in VLC, it frees 50MB.

Is it unreasonable that I expect Flash's media playback ability and resource usage to rival or best the playback of an open source program? Flash is owned and developed by one of the largest media authoring software companies in the world, right? Certainly they know something about efficient media playback.

edit: spelling ☹ ;)

0

u/[deleted] May 15 '10

[deleted]

0

u/jonhohle May 15 '10

So you need enough buffered in RAM to play until the next fault to disk is satisfied. This is how media players (and any software expecting a to deal with data larger than physical RAM) are written.

1

u/Peaker May 15 '10

I'd expect the OS memory management to move stuff from RAM to disk when it is unused. I don't think each and every application should replicate this logic.

5

u/lengau May 15 '10

Took a while to figure this out, but I think can replicate this in Firefox and Chrome on Mac and Linux now. If you load each video, go away from the player and then load the video again, it re-downloads it (without flushing the previous one from memory). This seems like either a Flash problem or a problem with their Flash script to me.

EDIT: I was able to get it to do this in Chrome on Windows, too.

9

u/Roph May 15 '10

I win, 78mb firefox memory usage, with this reddit thread and that (fully loaded) video open.

Enjoy your bad platform (and no, I don't mean flash).

4

u/[deleted] May 15 '10

Really switch to chrome or firefox for mac Chrome latest build peaked at about 215Mb with both vids playing Safari really sucks balls at Flash

5

u/artissco May 15 '10

Same with Firefox? Maybe this is Safari problem not Flash.

4

u/FRIEDjellyWALNUT May 15 '10

I'm at school, so I don't have time to take a screenshot, but Firefox barely hits 250 MB with that trailer fully loaded and playing.

2

u/[deleted] May 15 '10

Here on Ubuntu 10.04 (Firefox 3.6.3 with Flash Player 10.1 RC4) it's slightly above 200Mb when fully loaded and playing. CPU usage is brutal though.

2

u/seraph582 May 24 '10

Where did flash fanboys come from? Nobody has ever been a flash fanboy until recently... Lol @ flash

0

u/[deleted] May 15 '10

[deleted]

1

u/jonhohle May 16 '10

Flash Player runs in a separate process, so this is just Flash Player and the overhead of the plugin host process, not Safari itself.

1

u/istrebitjel May 16 '10

On Windows in Chrome Flash is also running a separate process. http://imgur.com/ATnYY.png Flash is taking up 86MB and the trailer is fully buffered.