Eclipse Tip: Avoid Memory leaks

A simple solution to understand memory consumption is the variable view in Eclipse Helios which has a new column called Instance Count. It allows us to see the number of active instances of any object.

Eclipse Tip: Change variable values while debugging

When you are debugging, some times, you would want to change the value of a variable. For example a variable is null and you know you are going to encounter the dreaded NullPointerException. If you could just set the correct value to it you can proceed with the debugging and worry about the null check later.

Eclipse tip: Conditional breakpoints

Eclipse provides a very nice debugging environment. One of the features I use often is conditional breakpoints. It is essentially breakpoints which suspend code execution only when a specified condition is satisfied. For example you want to set a breakpoint inside a loop but only are interested when a certain variable is null. To specify a condition select ‘Breakpoint Properties…‘ in the context menu of the breakpoint.

Eclipse tip: Type Filters

Eclipse provides a lot of useful assistance to developers like the code completion, finding types or quick fix proposals. But if you have a large number of libraries in your projects these assistance can be a bit overwhelming. For instance you might be developing a web application but you might see Swing or AWT types in code assists. Eclipse provides a solution for this problem with Type Filters. Go to Window>Preference>Java>Type Filters and add the packages you do not want to see. You can add javax.swing.* and java.awt.*.

Sandeep Joshi
Mathematics, Technology and Programming are my passion. I am a part of Java Ecosystem and through this blog, I contribute to it. I am here to blog about my interests, views and experiences.
I am on Google+ and Facebook.
I feel proud to be listed as a "National Memory Record Holder" in the Limca Book of Records, 2009 and have attempted for an International Memory record in the Guiness Book of Records. I can remember the value of PI upto 10,000 digits after the decimal (3.1415.....). You can contact me on ; I would like to hear from you :)