Re: memory management



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
.



Relevant Pages

  • Re: memory management
    ... 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. ...
    (comp.lang.java.programmer)
  • memory management
    ... I put them with an insert preparedStatement in ... a destination db but the jave process increase the memory until it ... also If I increase Tomcat java memory when I ...
    (comp.lang.java.programmer)
  • Re: memcpy to PCI Adapter Memory
    ... I thus always dword align the destination before ... REP MOVSD in assembler code (which I don't use very often anymore ... >(i.e. checking for alignment, using largest word size possible), and others ... This is why a HAL routine to optimize memory moves ...
    (microsoft.public.development.device.drivers)
  • Re: BitBlt(,,,,,,,,dwRop)
    ... I am making bitmappasting operation from ... changed by source bitmap(here is clipboard). ... Get the "destination" bitmap and the ... Then use TransparentBlt to copy from the "destination" memory DC ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Init big array data
    ... Using memcpy, ... After that the pointers to the ... The destination pointer is advanced, ... blocks of memory is not optimized for block-transfer of memory?! ...
    (comp.lang.c)