I'm working on a memory intensive web app (on the order of several hundred megabytes to a gigabyte or more) and I'm trying to figure out what my options are for memory management. There doesn't seem to be any way to figure out if my application is approaching the memory limit of the browser / Javascript engine, and once the app exceeds that limit the browser just crashes. I could just be super conservative with the amount of memory I use in order to support browsers running on low end machines, but that will sacrifice performance on higher end machines. I know Javascript was never designed to be able to use large amounts of memory, but here we are now with HTML5, canvas, WebGL, typed arrays, etc and it seems a bit short sighted that there isn't also a way in Javascript to determine how much memory a script is able to use. Will something like this be added to browsers in the future, or is there a browser specific API available now? What are my options here?
Update
I'm not sure that it matters, but for what it's worth I'm displaying and manipulating hundreds of large images, in file formats not supported by web browsers, so I have to do all of the decompression in Javascript and cache the decompressed pixel data. The images will be displayed on a canvas one at a time and the user can scroll through them.