Skip to main content

What does com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize do?

4 replies [Last post]
Joined: 2003-06-23

Due to classloader constraints when loading JAXB generated code into
an OSGi bundle, we've had to set this magic property to true, preventing
the reference impl from force-feeding a class (via defineClass) into a
classloader that already has the class defined.

Thing is, we don't know what the side-effects may be. I think it might
just cause things to slow down ever so slightly, but is there more to it?


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2005-03-17

I've found that this helps with launching debuggers. I've sometimes had a problem when launching a GUI application from my IDE. It often hangs before reaching the main window. It happens under both IntelliJ and NetBeans, although it may happen with others, too. But when I launch with this property set to true, the debugger never hangs. I don't know why. Does anyone know what's going on?

Joined: 2005-09-06

No, it is an optimization only feature.

Joined: 2005-08-17

Any word on how much this slows things down?

Joined: 2003-06-09

We don't really measure it, so I don't know for sure actually.

But unless you are in the server environment or something where the sustained unmarshalling performance is important, I wouldn't worry about it.

If you are unmarshalling XML just once or twice, then this might even be a win, because of the reduced time it takes to set up JAXBContext.