java - Disadvantages of having child first class loader? -
i developing application loads different apps in different class loaders, thinking use child first class loader. solve problem child apps have dependency on different version of class, main application uses. there side effects using approach? if yes can suggest me approach solve problem?
the side effects are:
- you use more memory store multiple versions of class (shouldn't problem really)
- make sure class instances never cross boundaries. if load classfile twice 2 different classloaders, not compatible
for example:
a = new a(); // classloader1 system.out.println(a instanceof a) // classloader2
this print "false"
Comments
Post a Comment