changeset 1118:07e7d6fb6ee1

7901288: JMH BinaryLinkClient builds up garbage over time
author shade
date Thu, 05 Feb 2015 15:51:58 +0300
parents 0797222e066e
children 87d16fe4bf92
files jmh-core/src/main/java/org/openjdk/jmh/runner/link/BinaryLinkClient.java
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/link/BinaryLinkClient.java	Tue Feb 03 12:18:35 2015 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/link/BinaryLinkClient.java	Thu Feb 05 15:51:58 2015 +0300
@@ -82,9 +82,14 @@
             throw new IOException("Link had failed already");
         }
 
+        // It is important to reset the OOS to avoid garbage buildup in internal identity
+        // tables, and as much as important to flush the stream to let the other party
+        // know we pushed something out.
+
         synchronized (lock) {
             try {
                 oos.writeObject(frame);
+                oos.reset();
                 oos.flush();
             } catch (IOException e) {
                 failed = true;