Immediatly after the call to the function docToPdf() method, You are recycling both agentContext and session objects. Don't. Since Session is a singleton object, created by Domino server itself, You can't recycle it, but when You call the recycle, You are telling Domino to recycle EVERYTHING that is created from the Session object.
The same goes with agentContext.recycle(). Don't. You haven't created the agent context. It is created by the Session object, and it is therefore the session object's responsibility to recylce the context.
So, remove the lines:
Other than that; I don't see anything wrong with the code.
"java/lang/OutOfMemoryError" when r... (Aden Roper 1.May.12)
Feedback response number WEBB8TW9FJ created by Kenneth Axi on 05/02/2012
. . Garbage collection/Recycling issues... (Kenneth Axi 1.May.12)
. . . . Updated Code (Aden Roper 1.May.12)
. . . . . . Dont recycle object that You have c... (Kenneth Axi 2.May.12)
. . . . . . . . To add to your comments. (Simon O'Doherty... 2.May.12)