• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

$.getJSON leaking memory?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Self destruct mode activated. Instructions for deactivation encoded in this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic