1

Topic: Memory leak

Colleagues, prompt please why without the unit finally happens memory leak? @Override public void run () {//TODO Auto-generated method stub while (true) {Product product = null; try {product = getQueue ().take (); logger.info ("Consuming product" +product.toString ()); consume (product);} catch (Exception e) {//TODO Auto-generated catch block if (null! =product) product.setProcessingError (true); e.printStackTrace ();} finally {product = null;}}}

2

Re: Memory leak

3

Re: Memory leak

Hello, purser, you wrote: P> I See in the manager of tasks as  storage and a computer starts to brake try-finally in your code on what does not influence. Search for a problem in other. To begin with it is necessary to transfer to the virtual machine parameter-Xmx to restrict its appetite on operative storage. If after that the program starts to fall with OutOfMemoryError, to remove a memory dump of the program and to look, where storage left.

4

Re: Memory leak

Hello, purser, you wrote: P> Colleagues, prompt please why without the unit finally happens memory leak? Run an application under eclipse memory analyzer. To me he not once or twice helped to struggle with leaks.