Javascript Memory Limitations

M

MC

Hi,

I was wondering if anyone had any data on the limitations of the current
browsers, specifically IE8, IE9 FF 3.5+, and Chrome. I am building a large
javascript browser application handling a lot of data and multiple pages and
just wondering if I'm going to have problems.

Thanks,
Mica
 
D

David Mark

Hi,

I was wondering if anyone had any data on the limitations of the current
browsers, specifically IE8, IE9 FF 3.5+, and Chrome.

What sort of (memory) limitations?
I am building a large
javascript browser application handling a lot of data and multiple pages and
just wondering if I'm going to have problems.

The Magic 8-ball says: signs point to yes.
 
E

Evertjan.

MC wrote on 14 aug 2010 in comp.lang.javascript:
I was wondering if anyone had any data on the limitations of the
current browsers, specifically IE8, IE9 FF 3.5+, and Chrome. I am
building a large javascript browser application handling a lot of data
and multiple pages and just wondering if I'm going to have problems.

All memory will be confined to a per page maximum, if my memory serves me
correctly.

You will get problems with such large undertakings especially cross-browser
ones.

Why not keep the lunb of the data on the server and use serveride
databases?
 
M

MC

Evertjan. said:
MC wrote on 14 aug 2010 in comp.lang.javascript:


All memory will be confined to a per page maximum, if my memory serves me
correctly.

You will get problems with such large undertakings especially
cross-browser
ones.

Why not keep the lunb of the data on the server and use serveride
databases?

So no one has any hard data on any of the browsers.
I really don't want to discuss the why and go into that rabbit hole. Suffice
it to say that letting the browser handle the data can significantly
increase the speed at which users are able to use our software.
 
M

Michael Haufe (\TNO\)

I was wondering if anyone had any data on the limitations of the current
browsers, specifically IE8, IE9 FF 3.5+, and Chrome. I am building a large
javascript browser application handling a lot of data and multiple pages and
just wondering if I'm going to have problems.

So no one has any hard data on any of the browsers.
I really don't want to discuss the why and go into that rabbit hole. Suffice
it to say that letting the browser handle the data can significantly
increase the speed at which users are able to use our software.

Your question is too vague to give you an appropriate answer. As it
stands the answer is "yes and no" depending on what you're trying to
accomplish and how you go about it. What is "a lot of data"? 1 MB? 1
GB? Textual data? Binary? How much communication between the server
client is there? etc....
 
M

MC

I was wondering if anyone had any data on the limitations of the current
browsers, specifically IE8, IE9 FF 3.5+, and Chrome. I am building a large
javascript browser application handling a lot of data and multiple pages
and
just wondering if I'm going to have problems.

So no one has any hard data on any of the browsers.
I really don't want to discuss the why and go into that rabbit hole.
Suffice
it to say that letting the browser handle the data can significantly
increase the speed at which users are able to use our software.
Your question is too vague to give you an appropriate answer. As it
stands the answer is "yes and no" depending on what you're trying to
accomplish and how you go about it. What is "a lot of data"? 1 MB? 1
GB? Textual data? Binary? How much communication between the server
client is there? etc....

I am looking for information such as:
Is there a set max memory for a browser or the parser?
Is there a way to test to see if how much utilization is done?
Does memory depend on the browser computer as opposed to some set limit?

We are looking at a browser holding about .15mb data text,
and a single page size of around 20,000 lines of html and javascript.
There are about 20 forms in the page and an ajax update of the server is
done
every time the user leaves one form and goes to the next.
 
E

Evertjan.

MC wrote on 17 aug 2010 in comp.lang.javascript:

[please do not quote signatures on usenet]
So no one has any hard data on any of the browsers.

What do you mean by "hard data"? Data is data, meseems.

Do you mean persistent data between pages or sessions?

Present day browsers only have cookies for such use, as identifiers of old
and present sessions and some other data, or perhaps querystring data.
I really don't want to discuss the why and go into that rabbit hole.

This is usenet. You cannot limit the response to your postings.
What do you have against rabbits exor their holes, btw?
Suffice it to say that letting the browser handle the data can
significantly increase the speed at which users are able to use our
software.

No that does not suffice, as there are far more important issues, like
security, cross browser reliability.

Subjective user speed can be an buying incentive, but that will be cheating
your customer if you degrade security and reliability for that.

Do you really think your web-pages will work correcly on most of the
browsers on an Andriod, Symbian, or Windows Mobile platform, or a text-only
browser like Lynx?
 
M

Michael Haufe (\TNO\)

I am looking for information such as:
Is there a set max memory for a browser or the parser?

There is no practical limit per se for the browsers you've mentioned,
though depending on how your code is written, and the age of the
client machine, things could well indeed become unusable.
Is there a way to test to see if how much utilization is done?
Does memory depend on the browser computer as opposed to some set limit?

I would say don't worry about this level of detail at this stage. In
Firefox at least you can type about:memory in the address bar to get a
generic overview of memory use.

We are looking at a browser holding about .15mb data text,

I assume you meant 15 MB and not 150kb.
and a single page size of around 20,000 lines of html and javascript.
There are about 20 forms in the page and an ajax update of the server is
done
every time the user leaves one form and goes to the next.

Why would you need 15MB of data on every page to fill out a small
number of forms? Since you'll already have a back and forth channel to
the server, could you not load the relevant data on demand?

This data can be stored on the client outside of RAM if necessary, but
I'm curious to what the necessity is to have it all available at once
anyway instead of loading bit s of it at a time as the relevant forms
are needed.
 
M

Michael Haufe (\TNO\)

Do you really think your web-pages will work correcly on most of the
browsers on an Andriod, Symbian, or Windows Mobile platform, or a text-only
browser like Lynx?


Probably not as the OP did not mention any concern about the browsers
not mentioned in his/her list.
 
M

MC

Do you really think your web-pages will work correcly on most of the
browsers on an Andriod, Symbian, or Windows Mobile platform, or a
text-only
browser like Lynx?


Probably not as the OP did not mention any concern about the browsers
not mentioned in his/her list.
 
M

MC

I am looking for information such as:
Is there a set max memory for a browser or the parser?

There is no practical limit per se for the browsers you've mentioned,
though depending on how your code is written, and the age of the
client machine, things could well indeed become unusable.
Is there a way to test to see if how much utilization is done?
Does memory depend on the browser computer as opposed to some set limit?

I would say don't worry about this level of detail at this stage. In
Firefox at least you can type about:memory in the address bar to get a
generic overview of memory use.

We are looking at a browser holding about .15mb data text,

I assume you meant 15 MB and not 150kb.
and a single page size of around 20,000 lines of html and javascript.
There are about 20 forms in the page and an ajax update of the server is
done
every time the user leaves one form and goes to the next.

Why would you need 15MB of data on every page to fill out a small
number of forms? Since you'll already have a back and forth channel to
the server, could you not load the relevant data on demand?

This data can be stored on the client outside of RAM if necessary, but
I'm curious to what the necessity is to have it all available at once
anyway instead of loading bit s of it at a time as the relevant forms
are needed.

----------------
Actually, the size of the data is .15mb or 150kb. What we are doing is
necessary or else we would need to hold most of the data in session on the
server and do a lot of manipulation and page refreshes. The data is required
accross the set of forms for what we are doing and it and the forms are
dynamic. So we may have a location section, dynamically add/delete more
locations, which will cause sections on other forms to automatically change.
The html code actually will change along with the data.

A competitors normal business case scenario can take upwards of one hour to
fill over the web using single form pages and caching data on the server. We
are seeing times of around 30 minutes or less and the users really like it
which means they are much more likely to use it.
 
M

MC

Stefan Weiss said:
And do you know which operating systems your user base is running, and
how their browsers are set up?
The point is that there's no such thing as "hard data" about maximum
memory usage in a browser. It all depends on your users' setup. I've
seen browsers use all available memory and then start to fill the swap
space (aka page file), consuming gigabytes or memory, I've seen browsers
return "out of memory" errors for much less, and I've seen browsers
"vanishing" abruptly because the process was killed by the OS due to
excessive memory usage. Some systems need to be more strict about
runaway processes than others (for example, mobile platforms or
servers). As far as I can tell, there is no single answer to your
question - there are too many variables. However, if the number you
quoted before is accurate (150KB or even 15MB), you should be fine in
most any environment. That's not even close to what some other current
apps (and some exotic libraries) require from browsers.

How did you calculate the prospective memory usage? I'm honestly
curious, because I wouldn't know how to do that (apart from measuring).
If you're talking about 150k of raw data stored in JS strings, the
actual memory usage is going to be quite a bit higher (more if there are
many small strings, less if there's one 150k string). If the data is
contained in HTML elements in the document itself, the resourse usage is
going to be even heavier. In any case, 150k should not present much of a
problem for a typical client.

You said it was a business application. In that case, odds are that at
least some of your users will be running MSIE browsers, and you should
be aware that Internet Explorer (especially the older versions) is
notorious for its memory leaks. Search at the group archive for
suggestions about how avoid these. In my experience, IE can also slow
down to a crawl on "heavy" pages (many DOM elements, large arrays, etc).

HTH

Stefan,

Most of the data will be in the data model AND in the html elements. We are
able to measure the size of the json objects being sent and retrieved on the
server. I realize this is only an approximation of how the browser is
handling it. I'm really more concerned about the number of lines of html/js
and the number of forms as far as limitations go.

We have already established a minimum criteria of IE8+, FF 3.5+ and Chrome
5+. Since this is a business application, we can expect our users to comply.
We already track our users browser data in our login database and can deal
with this issue comfortably. (It already breaks IE7)

Thank you,
Mica
 
M

Michael Haufe (\TNO\)

Actually, the size of the data is .15mb or 150kb. What we are doing is
necessary or else we would need to hold most of the data in session on the
server and do a lot of manipulation and page refreshes. The data is required
accross the set of forms for what we are doing and it and the forms are
dynamic. So we may have a location section, dynamically add/delete more
locations, which will cause sections on other forms to automatically change.
The html code actually will change along with the data.

A competitors normal business case scenario can take upwards of one hour to
fill over the web using single form pages and caching data on the server.We
are seeing times of around 30 minutes or less and the users really like it
which means they are much more likely to use it.


Please keep the proper level of quote nesting.

With just 150kb of data, I have a hard time picturing why it should
take 30 mins to render what seems like a straightforward CRUD
application. Is this 150kb transferred on every page? Or is it sent
all at once? Perhaps I'm just not understanding the scope. Where is
this time bottleneck at? Rendering, communication, DB queries/updates?
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
We are looking at a browser holding about .15mb data text,

In <URL:http://www.merlyn.demon.co.uk/js-misc0.htm#MLS>, button "Wombat"
will create 12345678 repeats of "+" in a string in about 0.1 second
using FF 3.0.19 in WinXP sp3 on P4/3GHz with 1GB RAM. You should have
no problem with the minute fraction of one bit of data that you asked
about, or even with the 0.15MB that you probably intended.

Going to 123456789 took about half a minute, and made parts of the
machine slow thereafter, doubtless due to having 246,913,578 bytes of
string in use.

I expect the practical limit to depend on the OS, the amount of RAM, and
whether anything much else is loaded or working at the same time; ICBW.
 
E

Evertjan.

Hans-Georg Michna wrote on 20 aug 2010 in comp.lang.javascript:
In my experience you will not have any space problems with that.
I have written a fun application, http://winhlp.com/telly/ ,
that loads 12 MB of JSON data, and I never ran into any space
problems.

There may be two other problems though. One is that the browsers
appear to use memory very inefficiently, meaning that they may
use up to 100 bytes for every actual byte you load.

The other is that your program may be slow when handling larger
amounts of memory.

Ultimately I think you should just try it and test it on as many
browsers as possible.

I yet fail to see any advantages of doing such things clientside,
while there are these many disadvantages I talked about.

The user cannot really need 12Mb in its machine-user interface.

So why not do this serverside?
 
D

Dr J R Stockton

In comp.lang.javascript message <9dlt66p9n2dmlqud7eujp2nsh06pi77smh@4ax.
com>, Fri, 20 Aug 2010 22:07:00, Hans-Georg Michna <hans-
(e-mail address removed)> posted:
The other is that your program may be slow when handling larger
amounts of memory.

Ultimately I think you should just try it and test it on as many
browsers as possible.

As many browsers, and also on slow machines with limited RAM and slow
discs, to the extent that the target readership is likely to need to use
such.
 
E

Evertjan.

Hans-Georg Michna wrote on 21 aug 2010 in comp.lang.javascript:
First of all, this was just a fun project. I wanted to see how
far one could go with driving JavaScript to its limits. What I
found is that, with some little tricks, it goes pretty far.

Sure, however my comment was not about your programme, but about the OP's
intentions.

The other point is that a program like Telly is
computation-intensive. If it is done client-side, tens, even
hundreds of thousands of users could use it simultaneously. (Not
that Telly will ever get used that much. :) Once the program
and the data is downloaded and cached, the server can idle and
server other users.

Do the same on the server, and it will break down even with a
few hundred or thousand simultaneous users.

Good point, I did not think of that.

Sort of distributed computing.
Perhaps we could do more nice things that way.

================

However, in the case of the OP, who is Ajaxing 2.5 MB on every form,
this would not apply, since the Ajaxing would have the same effect with a
few thousand simultaneous users.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top