java - Using blocks to limit the scope of variables inside lengthy(taking long operation time) functions, to free up heap quickly -
i using java web application. free heap of unneccesary variables objects, better strategy using blocks limit scope of variables inside lengthy(taking long operation time) functions , free space possible ?
i understand splitting methods smaller ones idea, after feel need use blocks in smaller functions.
i use several blocks inside single functions whenever job of variable on gets out of scope , garbage collector can clean space quick possible
that should work, if blocks can identified independent each other should possible find name describes duty , make them separate methods.
smaller methods more easy reason about, , more easy test code in testing framework.
Comments
Post a Comment