Results 1 to 5 of 5
Thread: avoiding memory over-consuming
- 12-13-2009, 04:04 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 99
- Rep Power
- 0
avoiding memory over-consuming
Hi
An application that I made take a lot of memory. a lot.
The application include GUI and managment of small database - and yet, if open for several days without reset - I see it consumes 700 MB
I start read about
My main Class , called Seal.
Many object and many method , static and regular , have the main class as argument
i.e.
public ActionListenerToSeal2(Seal seal1, String key1,JCheckBox b1){ .. }
public static boolean verifyStatusChange(Seal seal, String key) {... }
private void updateSpcVarFromGloabl(Seal seal) { .... }
I I understand right - having 'Seal seal ' as an argument prevent this object to be deleted ?
- 12-13-2009, 07:57 PM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 294
- Rep Power
- 0
I dont know but I would guess so, Why else would it be named seal?
- 12-14-2009, 08:25 AM #3
Member
- Join Date
- Dec 2008
- Posts
- 99
- Rep Power
- 0
Seal is just the name of the main object - which control both GUI and database. its object that open only once and exist as long as the program is working
the question is - if temporery objects that link the this primary class - will remain in the memory ? is that the root cause of my memory problem ?
If do - what can I do instead of linking to the main object
- 12-14-2009, 09:22 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
No, having "Seal seal" as an argument does not prevent anything from being garbage collected. Analyse your code. Are you maybe adding things to maps or lists and then not deleting them when no longer needed?
- 12-14-2009, 11:59 AM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,466
- Rep Power
- 16
Similar Threads
-
Avoiding system.exit()
By swati.jyoti in forum New To JavaReplies: 5Last Post: 07-01-2009, 10:17 AM -
how do I increase memory allocated to code cache (Non Heap Memory)
By manibhat in forum Advanced JavaReplies: 2Last Post: 08-21-2008, 07:33 PM -
Avoiding refresh
By java_srinivasan in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 06-25-2008, 09:01 AM -
avoiding if statements
By valoyivd in forum New To JavaReplies: 1Last Post: 04-02-2008, 09:08 AM -
How to reduce the size or avoiding out of memory error?
By rajeshkumarmsc in forum Advanced JavaReplies: 3Last Post: 08-11-2007, 10:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks