0

When I run certain agents, in which I recycle my objects I sometimes get this message when running the agents:

java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3580)
    at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:129)
    at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:104)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:164)
    at lotus.domino.ClassHashtable.explodeArchive(Unknown Source)
    at lotus.domino.ClassHashtable.addAttachment(Unknown Source)
    at lotus.domino.AgentLoader.addAttachment(Unknown Source)

How can I find out in which agent or which object this memory gets full? And how can I empty the memory again..

Nuri Ensing
  • 1,899
  • 1
  • 19
  • 42

2 Answers2

1

In Eclipse, you can stop you debug when the exception is thrown:

Break when exception is thrown

NikNik
  • 2,191
  • 2
  • 15
  • 34
1

There is no way to "empty the memory again", and without a thorough review of all of your code nobody here is going to be able to help you find the source of your leak. You may want to review this answer to an older question here on StackOverflow for ideas about how to try and track down your leak.

Of course, in Domino agents the most common issue is non-recycled objects, so although you say you are recycling I'd look for any possible branches in which you may be missing a recycle() call. Or, I'd consider using the OpenNTF Domino API instead of the standard API, as it eliminates the need to make recycle() calls.

Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41