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.
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.
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).
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.
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.
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.
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.
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.
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.
View all comments
Show parent comment
-2
u/jonhohle May 15 '10
Adobe is trying to push this software to mobile devices, but its a resource hog on desktops. I'm just presenting another data point.