Re: memory management
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 18:08:10 GMT
On Wed, 31 Oct 2007 02:22:39 -0700, josh <xdevel1999@xxxxxxxxx> wrote,
quoted or indirectly quoted someone who said :
in a while loop I get from a db some records and in the same time
I put them with an insert preparedStatement in
a destination db but the jave process increase the memory until it
goes in out of memory.
The general advice is:
1. don't hold onto anything any longer than you have to. The idea
would be to read one record, process one record, then let go of all
objects involved.
2. if you have to hold onto something for a while, hold onto it its
most compact form. This may been processing it or delaying processing
it.
3. read up on packratting to make sure you are not inadvertently
holding onto something you don't need to.
http://mindprod.com/jgloss/packratting.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- References:
- memory management
- From: josh
- memory management
- Prev by Date: Re: Great SWT Program
- Next by Date: Re: Great SWT Program
- Previous by thread: Re: memory management
- Next by thread: How to test a class that is started via a Servlet.
- Index(es):
Relevant Pages
|