Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Javascript Memory Limitations

5,628 views
Skip to first unread message

MC

unread,
Aug 14, 2010, 4:13:00 PM8/14/10
to
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


David Mark

unread,
Aug 14, 2010, 4:24:39 PM8/14/10
to
On Aug 14, 4:13 pm, "MC" <mica[removethis]@aisus.com> wrote:
> 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.

Evertjan.

unread,
Aug 15, 2010, 12:09:34 PM8/15/10
to

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?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

MC

unread,
Aug 17, 2010, 9:54:10 AM8/17/10
to

"Evertjan." <exjxw.ha...@interxnl.net> wrote in message
news:Xns9DD5B8BC...@194.109.133.242...

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.


Michael Haufe ("TNO")

unread,
Aug 17, 2010, 1:06:43 PM8/17/10
to
On Aug 14, 3:13 pm, "MC" <mica[removethis]@aisus.com> wrote:

> 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.

On Aug 17, 8:54 am, "MC" <mica[removethis]@aisus.com> wrote:

> 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....

MC

unread,
Aug 17, 2010, 2:02:20 PM8/17/10
to

"Michael Haufe ("TNO")" <t...@thenewobjective.com> wrote in message
news:7bce5124-2334-42f5...@l14g2000yql.googlegroups.com...

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.


Evertjan.

unread,
Aug 17, 2010, 5:01:55 PM8/17/10
to
MC wrote on 17 aug 2010 in comp.lang.javascript:

>
> "Evertjan." <exjxw.ha...@interxnl.net> wrote in message

[..]
>> Why not keep the lumb of the data on the server and use serveride
>> databases?

[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?

Michael Haufe ("TNO")

unread,
Aug 17, 2010, 7:24:47 PM8/17/10
to
On Aug 17, 1:02 pm, "MC" <mica[removethis]@aisus.com> wrote:

> 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.

Michael Haufe ("TNO")

unread,
Aug 17, 2010, 7:27:04 PM8/17/10
to
On Aug 17, 4:01 pm, "Evertjan." <exjxw.hannivo...@interxnl.net> wrote:

> 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.

MC

unread,
Aug 17, 2010, 8:46:08 PM8/17/10
to

"Michael Haufe ("TNO")" <t...@thenewobjective.com> wrote in message
news:0b615d8d-e312-45cd...@v8g2000yqe.googlegroups.com...

---------
Correct. This is a business application and we already know what our user
base is using and we can set minimum configurations.


MC

unread,
Aug 17, 2010, 9:05:01 PM8/17/10
to

"Michael Haufe ("TNO")" <t...@thenewobjective.com> wrote in message
news:e8f28019-c15d-4d65...@q22g2000yqm.googlegroups.com...

----------------
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.


Stefan Weiss

unread,
Aug 17, 2010, 9:28:27 PM8/17/10
to

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

MC

unread,
Aug 17, 2010, 11:52:07 PM8/17/10
to

"Stefan Weiss" <krewe...@gmail.com> wrote in message
news:JvqdndOiNLejqvbR...@giganews.com...

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


Michael Haufe ("TNO")

unread,
Aug 18, 2010, 12:48:20 AM8/18/10
to
On Aug 17, 8:05 pm, "MC" <mica[removethis]@aisus.com> wrote:

> 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?

Dr J R Stockton

unread,
Aug 18, 2010, 12:37:43 PM8/18/10
to
In comp.lang.javascript message <7585a$4c6aceb6$4b582b28$13...@ALLTEL.NE
T>, Tue, 17 Aug 2010 13:02:20, MC <mica@[removethis].invalid> posted:

>
>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.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Hans-Georg Michna

unread,
Aug 20, 2010, 4:07:00 PM8/20/10
to

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.

Hans-Georg

Evertjan.

unread,
Aug 20, 2010, 4:52:35 PM8/20/10
to

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?

Hans-Georg Michna

unread,
Aug 21, 2010, 11:55:36 AM8/21/10
to

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.

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.

Hans-Georg

Evertjan.

unread,
Aug 21, 2010, 2:11:27 PM8/21/10
to
Hans-Georg Michna wrote on 21 aug 2010 in comp.lang.javascript:

>>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?
>
> 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.

Dr J R Stockton

unread,
Aug 21, 2010, 2:00:41 PM8/21/10
to
In comp.lang.javascript message <9dlt66p9n2dmlqud7eujp2nsh06pi77smh@4ax.
com>, Fri, 20 Aug 2010 22:07:00, Hans-Georg Michna <hans-
georgNoEm...@michna.com> 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.

0 new messages