diff src/share/vm/utilities/numberSeq.cpp @ 5938:2c0751569716

7152954: G1: Native memory leak during full GCs Summary: Add destructor to TruncatedSeq and call delete when necessary Reviewed-by: johnc, tonyp
author brutisso
date Tue, 13 Mar 2012 21:12:53 +0100
parents f95d63e2154a
children bbc900c2482a
line wrap: on
line diff
--- a/src/share/vm/utilities/numberSeq.cpp	Mon Mar 12 13:12:07 2012 -0700
+++ b/src/share/vm/utilities/numberSeq.cpp	Tue Mar 13 21:12:53 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -156,6 +156,10 @@
     _sequence[i] = 0.0;
 }
 
+TruncatedSeq::~TruncatedSeq() {
+  FREE_C_HEAP_ARRAY(double, _sequence);
+}
+
 void TruncatedSeq::add(double val) {
   AbsSeq::add(val);