RE: How to automate the garbage collection execution in liferay 6.2 CE por

Jamie Sammons, modified 4 Years ago. New Member Post: 1 Join Date: 10/28/20 Recent Posts

I want to write a script for automating garbage collection:

Control Panel -> Server administration -> Garbage collection(execute)

 

Can anyone please suggest.

thumbnail
Mohammed Yasin, modified 4 Years ago. Liferay Master Posts: 593 Join Date: 8/8/14 Recent Posts

Hi ,

You can call gc in Java by   

Runtime.getRuntime().gc();

thumbnail
Olaf Kock, modified 4 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

I'd say: You're done already: Garbage collection is already automatic in Java. No need for any custom implementation.