Friday, March 13, 2009

Can I invoke Runtime.gc() in an EJB (EJB)

Question :Can I invoke Runtime.gc() in an EJB? (EJB)
Answer :You shouldn't.
What will happen depends on the implementation, but the call will most
likely be ignored. You should leave system level management like garbage
collection for the container to deal with. After all, that's part of the benefit
of using EJBs, you don't have to manage resources yourself.

No comments: