users@glassfish.java.net

Goodbye CDI

From: <glassfish_at_javadesktop.org>
Date: Tue, 17 Aug 2010 05:58:57 PDT

Running the Eclipse Memory Analyzer on a heap dump of my web app, I found out that about 90 % of memory was used by org.jboss.weld.* instances.

Given the amount of time I've spent in the past few months analyzing CDI/Weld-related problems, this was now the last straw.

I've eliminated all CDI usage from my application, which basically amounted to replacing all @Inject annotations by @EJB and was just an hour's work.

After this change, the heap memory usage has dwindled down from 500 MB to less than 50 MB, and the application starts a lot faster than before.

Unlike JPA, CDI has no pluggable interface for different implementations, so for Glassfish users, CDI and Weld are synonymous and it is hard to tell whether the issues I've experienced are rooted in the specification or in the reference implementation.

For me, CDI has created a lot more problems than it actually solved, and I definitely cannot recommend Weld for production use. I'll wait for the Glassfish 3.1 release before giving CDI another try, but I expect it will take another year or so for CDI to stabilize.

Regards,
Harald
[Message sent by forum member 'hwellmann']

http://forums.java.net/jive/thread.jspa?messageID=480385