Posts

Showing posts from August, 2006

Monitoring tools for Sun Java SE 6

Here is a good article flying over tools that are usefull to monitor JVM 1.6 :

http://java.sun.com/developer/technicalArticles/J2SE/monitoring/

Monitoring the GC on JVM 1.4

As JConsole is provided with Java 1.5, Marco sent me a link to open source software that monitors the GC, using the jvm "verbosegc" option.

http://www.tagtraum.com/gcviewer.html

Understanding the garbage collector

Here is a good article (in french) by Romain Guy explaining how the Sun's JVM garbage collector works and how it is possible to set the GC mode

http://gfx.developpez.com/tutoriel/java/gc/

Memory dumps are usefull

Here is a JVM option very interesting :
-XX:+HeapDumpOnOutOfMemoryError usefull to identify memory leak responsability

Sun's JVM options : the (big) list

I just put this link (thanks to Marco) :

http://blogs.sun.com/roller/resources/watt/jvm-options-list.html

I 'll make no comment about the difficulty to tune a virtual machine. Oh.. I would said just a few words : prefer design and don't hope you will tune your quick development that has been quickly deployed in production under preasure.

Inside the Sun's JVM memory

Yesterday, my manager asked me about a problem concerning the eden space memory. So, this is a summary of JVM's memory management.
Heap Size
The allocation of memory for the JVM is specified using -X options when starting ColdFusionJVM option Meaning
-Xms initial java heap size
-Xmx maximum java heap size
-Xmn the size of the heap for the young generation
(extended options)
-XX:MaxPermSize maximum permanent generation size (for creating object instances)
For efficient garbage collection, the -Xmn value should be lower than the -Xmx value.Heap size does not determine the amount of memory your process uses
If you monitor your java process with an OS tool like top or taskmanager, you may see the amount of memory you use exceed the amount you have specified for -Xmx. -Xmx limits the java heap size, java will allocate memory for other things, including a stack for each thread. It is not unusual for the total memory consumption of the VM to exceed the value of -Xmx.Garba…

How to monitor your application

I just found an article about how to use the JConsole that is included in Java SE 1.5. The article also presents in a few words the JMX phylosophy.

http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html

SwingWeb 1.0 : a new swing to web bridge framework

Wooh! It's a great day. There's a new framework that allows to publish a swing application on the web. I just put the link here but I will write another message about it. This is really great.

http://swingweb.sourceforge.net/swingweb/

Batch processing in Hibernate

I read this article that is very interesting (thank you very much Marco) :

Suppose you need to insert 200,000 records into a database in Hibernate. You'll need to adjust the following settings:
//set the JDBC batch size (it is fine somewhere between 20-50)
hibernate.jdbc.batch_size 30

//disable second-lavel cache
hibernate.cache.use_second_level_cache false

//and now do your job like this
Session S=SF.openSession(); //SF = SessionFactory object
Transaction T=S.beginTransaction();

for (int i=0;i<200000;i++)
{
record r=new record(...);
S.save(record);
if(i % 30==0)
{ //30, same as the JDBC batch size
//flush a batch and release memory
session.flush();
session.clear();
}
}

//clean
T.commit();
S.close();
(Author : Anghel Leonard)

Debugging application servers

Today, I found a great article that explain how to debug remotly several application servers.

Follow this link

Java Look And Feel : a simple article

As I love simple articles, I found one interesting about how to male a Java Look And Feel. I think It's time for me to learn somthing different that rewriting the paint() method.

Link to the article


First Step

Humm... Well it's done! I don't want to spam Marco's blog (javacomptoir) anymore with dailly messages. On this blog, I will write about my readings, about articles I found on the web. In many cases, I will be about Java. But sometimes, It will be about related technologies such as databases, global software architecture and... my favorite activity during spare times : Violet, THE Very Intuitive Object modeling software that I develop behind Cay S. Horstmann.

Thus, this blog will be a sort of bookmark with some experience feedbacks