This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

$.getJSON leaking memory?

 
Mattias Andersson
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm a semi noob on javascript and have been dealing with JQuery for a little while now.
Im using $.getJSON and somehow I'm getting a memory leak of ~800 kb each request.
I'm using jquery-1.4.4.js and Struts 1.3.8.

In the following code snippet I have cut down the code to do nothing else than just calling my Struts actionclass.

In my Struts action class it looks like this


The leakage correlates to the size of "someData".
What am I doing wrong or missing here?

Sincerely, Mattias
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What Browser?

Well the object has to be loaded into memory so there will be a memory increase.
Do you really need that full 800kb every request? Seems like a little extreme.
Do you set the data object to null after using it?


Eric

 
Mattias Andersson
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both Firefox and IExplorer.

The amount of data is nothing more than a JSON array of JSONObjects.
The array is 5 long and the objects only contains a total of 4 attributes (boolean, boolean, string and int).

I can not understand how this can be 800kb.


I have tried to set the data to null (j = null). Nothing there.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic