Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript Memory Limitations

Reply
Thread Tools

Javascript Memory Limitations

 
 
MC
Guest
Posts: n/a
 
      08-18-2010

"Michael Haufe ("TNO")" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
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.

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


 
Reply With Quote
 
 
 
 
MC
Guest
Posts: n/a
 
      08-18-2010

"Stefan Weiss" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ...
> On 18/08/10 02:46, MC wrote:
>> "Michael Haufe ("TNO")" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> On Aug 17, 4:01 pm, "Evertjan." <(E-Mail Removed)> 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.
>>
>> ---------
>> Correct. This is a business application and we already know what our user
>> base is using and we can set minimum configurations.

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


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


 
Reply With Quote
 
 
 
 
Michael Haufe (\TNO\)
Guest
Posts: n/a
 
      08-18-2010
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?
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      08-18-2010
In comp.lang.javascript message <7585a$4c6aceb6$4b582b28$(E-Mail Removed)
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.
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      08-20-2010
Hans-Georg Michna wrote on 20 aug 2010 in comp.lang.javascript:

> On Tue, 17 Aug 2010 13:02:20 -0500, "MC"
> <mica[removethis]@aisus.com> wrote:
>
>>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.

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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Dr J R Stockton
Guest
Posts: n/a
 
      08-21-2010
In comp.lang.javascript message <9dlt66p9n2dmlqud7eujp2nsh06pi77smh@4ax.
com>, Fri, 20 Aug 2010 22:07:00, Hans-Georg Michna <hans-
http://www.velocityreviews.com/forums/(E-Mail 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.

--
(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.
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      08-21-2010
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.

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Limitations using 8GB Memory Clayton Windows 64bit 3 08-09-2008 07:13 PM
Virtual Memory limitations of 32-bit Program in x64 environment Spinnacre Windows 64bit 8 01-14-2007 06:07 AM
HTTPUnit and JavaScript - what are the limitations? AS Java 1 10-28-2006 09:13 PM
Memory Limitations for Perl Programs? Chris Hamel Perl Misc 6 09-08-2006 01:15 PM
Memory: measuring 5 limitations Bart Van der Donck Perl Misc 6 12-12-2003 04:32 PM



Advertisments