javascritp RIA and browser memory

Greetings to all,
In one of my upcoming project we have a need to develop a RIA in
single-application-page where everything is loaded using ajax and all
kinds of tricks to change the UI
however, I am afraid that the browser memory will increase as the user
will work through the application.

The application design has a single entry point and from then the DOM
is manipulated to show or hide relevant views.
Can anyone point me to a good reference about the browser memory
management or suggest what is the best practice for such application.

Advertisements

On Feb 14, 12:01 pm, itay <> wrote:
> Greetings to all,
> In one of my upcoming project we have a need to develop a RIA in
> single-application-page where everything is loaded using ajax and all
> kinds of tricks to change the UI
> however, I am afraid that the browser memory will increase as the user
> will work through the application.
>
> The application design has a single entry point and from then the DOM
> is manipulated to show or hide relevant views.
> Can anyone point me to a good reference about the browser memory
> management or suggest what is the best practice for such application.
>
> We are going to use native JS with jquery.
>
> any help will do...
> Cheers!

Hi,

There's a lot of differences in this respect. Basically, Chromes and
Operas will just crash badly at about 600MB..800MB of memory usage,
Firefox will allow for much more than that (and will throw a nice
exception instead of just crashing) but will slow down a lot, as far
as I can see, and Safari will happily allocate as much as solicited,
like crazy, up to several GigaBytes (I cut it at ~4500MB, when in the
activity monitor it was displaying an allocation of more than 9GB of
virtual memory), forcing the OS to swap out to disk if needed.

Also, the size of strings is in most browsers limited to 256Mb (Mega-
chars, really?). Again, not in Safari. (last time I checked, which is
quite a long time ago).

Here's a test you can use to force the browser to allocate memory like
crazy:

It just creates strings of 1MB (*) in a loop, filled with random
chars, and pushes them into an array.

(*)1 mega-character strings, really. I guess that's more likely 2MB in
most browsers, as a char in JS is 16bits. So perhaps the browser's
limits stated above are more likely about twice as much.
--
Jorge.

Advertisements

On Feb 14, 9:01 pm, itay <> wrote:
> Greetings to all,
> In one of my upcoming project we have a need to develop a RIA in
> single-application-page where everything is loaded using ajax and all
> kinds of tricks to change the UI

Sounds horrendous. For some idea of how it might turn out, have a play
here:

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!