java - How to know if Static Block Initialization has been run? -
i trying rid of memory leaks. i'd reset static variables of classes (not mine) class loader. there classes
attribute lists classes known classloader.
so want loop on , reflection set static variables null.
the problem classes have not been initialized (the static block initialization did not run). purpose reset values , unload classes, there no point initializing classes. moreover, when reset class root used in sbi of class child, running sbi of child can lead unexpected behavior...
so question is: there way know if sbi has been run jvm or not.
note:
to proposing use findloadedclass of classloader, there in specification important sentence: *in post, there important note: "loaded" doesn't mean "initialized". initialization happens @ precise moments defined jls3 $12.4.1 *
static
block initialized if class loaded on jvm.
is class loaded on jvm can detect classloader
Comments
Post a Comment