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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -