changeset 7081:c4fedef42f45

RT-37012: [media] Native memory leaking until nio.Buffers are GC'ed Reviewed-by: stayer, Alexander.Matveev@oracle.com
author anashaty
date Tue, 20 May 2014 19:01:59 +0400
parents 1000cd96bf56
children 2c13160443c2
files modules/media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java	Tue May 20 17:50:10 2014 +0300
+++ b/modules/media/src/main/java/com/sun/media/jfxmedia/locator/ConnectionHolder.java	Tue May 20 19:01:59 2014 +0400
@@ -39,6 +39,7 @@
 import java.nio.channels.FileChannel;
 import java.nio.channels.ReadableByteChannel;
 import java.util.Map;
+import sun.nio.ch.DirectBuffer;
 
 /**
  * Connection holders hold and maintain connection do different kinds of sources
@@ -229,6 +230,9 @@
                     file = null;
                 }
             }
+            if (buffer instanceof DirectBuffer) {
+                ((DirectBuffer) buffer).cleaner().clean();
+            }
         }
     }