Even if the StringBuilder was around for a while now, many people still use StringBuffer in single threaded applications. The main difference is stated in the StringBuffer comments:
“As of release JDK 5, this class has been supplemented with an equivalent class designed for use by a single thread, {StringBuilder}. The StringBuilder class should generally [...]
Filed under: Java API, Java Tips by Daniel Pietraru
No Comments »
Let’s imagine a very simple scenario. You are writing an application which would benefit from some user specific customization after deployment. Maybe some of your customers have specific algorithms to be executed in the context of your application. Maybe your application doesn’t solve just one problem but it is designed to solve a class of [...]
Filed under: Java API, Java Tips, Scripting by Daniel Pietraru
1 Comment »
An easy low cost method to check the activity of the garbage collector in the JVM is to tell the JVM to create an activity log. This is achieved for Sun JVMs using the non-standard command line option “-Xloggc:file_name“. This will tell the JVM to create a log file with a content similar with this:
Filed under: Java Tips by Daniel Pietraru
Comments Off