Minor memory issues in fastdebug build

Chuck Rasbold rasbold at google.com
Fri Dec 21 12:21:49 PST 2012


Jeremy needs a bug id and a sponsor for this change.

While it fixes only a minor memory leak, he is looking to get his feet wet
as we engage with the contribution process.

I've taken the liberty of creating a webrev at
http://cr.openjdk.java.net/~rasbold/XXXXXXX/webrev.00/

-- Chuck


On Wed, Dec 12, 2012 at 4:11 PM, Jeremy Manson <jeremymanson at google.com>wrote:

> Hi folks,
>
> I was playing with the fastdebug build, and I found a couple of
> trivial memory issues.  A patch follows: let me know if you want me to
> do some footwork to correct it (file a bug, etc).
>
> Jeremy
>
> diff -r 121aa71316af src/share/vm/runtime/vmStructs.cpp
> --- a/src/share/vm/runtime/vmStructs.cpp        Fri Dec 07 10:46:54 2012
> -0800
> +++ b/src/share/vm/runtime/vmStructs.cpp        Wed Dec 12 16:05:25 2012
> -0800
> @@ -3146,10 +3146,10 @@
>      s[len-1] = '\0';
>      // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
>      if (recursiveFindType(origtypes, s, true) == 1) {
> -      delete s;
> +      delete [] s;
>        return 1;
>      }
> -    delete s;
> +    delete [] s;
>    }
>    const char* start = NULL;
>    if (strstr(typeName, "GrowableArray<") == typeName) {
> @@ -3165,10 +3165,10 @@
>      s[len-1] = '\0';
>      // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
>      if (recursiveFindType(origtypes, s, true) == 1) {
> -      delete s;
> +      delete [] s;
>        return 1;
>      }
> -    delete s;
> +    delete [] s;
>    }
>    if (strstr(typeName, "const ") == typeName) {
>      const char * s = typeName + strlen("const ");
> @@ -3182,8 +3182,10 @@
>      s[len - 6] = '\0';
>      // tty->print_cr("checking \"%s\" for \"%s\"", s, typeName);
>      if (recursiveFindType(origtypes, s, true) == 1) {
> +      free(s);
>        return 1;
>      }
> +    free(s);
>    }
>    if (!isRecurse) {
>      tty->print_cr("type \"%s\" not found", typeName);
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20121221/945c9b8f/attachment.html 


More information about the hotspot-runtime-dev mailing list