Fwd: Request for review: 7173044: Memory monitor demo hangs if MemoryUsage obj returns -1 in getMax
David Holmes
david.holmes at oracle.com
Sun Jun 3 23:20:42 PDT 2012
On 4/06/2012 4:20 PM, Sean Chou wrote:
> Thanks David. Do I need one more reviewer to support as it is a
> modification to demo ?
I honestly don't know. It's a demo in serviceability area, so probably
someone from serviceability should also give thumbs up.
David
> On Mon, Jun 4, 2012 at 1:55 PM, David Holmes <david.holmes at oracle.com
> <mailto:david.holmes at oracle.com>> wrote:
>
> Looks okay to me.
>
> David
>
>
> On 4/06/2012 3:55 PM, Sean Chou wrote:
>
> Hi David,
>
> Thanks for your time, comments are added. The new webrev is
> http://cr.openjdk.java.net/~__zhouyx/7173044/webrev.02/
> <http://cr.openjdk.java.net/~zhouyx/7173044/webrev.02/> .
> Please have a look.
>
> On Mon, Jun 4, 2012 at 11:26 AM, David Holmes
> <david.holmes at oracle.com <mailto:david.holmes at oracle.com>
> <mailto:david.holmes at oracle.__com
> <mailto:david.holmes at oracle.com>>> wrote:
>
> Hi Sean,
>
> This seems reasonable. Perhaps add a couple of comments:
>
> 125 private float usedMemMax[]; // used when max pool size
> is undefined
>
> 202 if (totalMemory < 0) { // max is undefined for this pool
>
> David
> -----
>
>
>
> On 4/06/2012 12:12 PM, Sean Chou wrote:
>
> Hello,
>
> Would any one like to take one more look ? It will
> help much !
>
> ---------- Forwarded message ----------
> From: *Sean Chou* <zhouyx at linux.vnet.ibm.com
> <mailto:zhouyx at linux.vnet.ibm.com>
> <mailto:zhouyx at linux.vnet.ibm.__com
> <mailto:zhouyx at linux.vnet.ibm.com>>
> <mailto:zhouyx at linux.vnet.ibm.
> <mailto:zhouyx at linux.vnet.ibm.>____com
> <mailto:zhouyx at linux.vnet.ibm.__com
> <mailto:zhouyx at linux.vnet.ibm.com>>>>
> Date: Thu, May 31, 2012 at 3:17 PM
> Subject: Request for review: 7173044: Memory monitor
> demo hangs if
> MemoryUsage obj returns -1 in getMax
> To: serviceability-dev at openjdk.__j__ava.net
> <http://java.net>
> <mailto:serviceability-dev at __openjdk.java.net
> <mailto:serviceability-dev at openjdk.java.net>>
> <mailto:serviceability-dev@
> <mailto:serviceability-dev@>__o__penjdk.java.net
> <http://openjdk.java.net>
>
> <mailto:serviceability-dev at __openjdk.java.net
> <mailto:serviceability-dev at openjdk.java.net>>>
>
>
> Hi all,
>
> MemoryMonitor demo will hang if MemoryUsage obj
> returns -1
> in getMax method.
> The demo obtains totalMemory from getMax method, and it
> is used in
> following loop:
>
> " // .. Memory Free ..
> big.setColor(mfColor);
> int MemUsage = (int) (((totalMemory - usedMemory) /
> totalMemory) *
> 10);
> int i = 0;
> for ( ; i < MemUsage ; i++) {
> mfRect.setRect(x1+5,(float) y1+ssH+i*blockHeight,
> blockWidth, blockHeight-1);
> big.fill(mfRect);
> }
> "
> If -1 is returned, MemUsage becomes a very large
> positive
> value and
> the loop hangs
> the demo.
>
> The bug is not seen in current openjdk because the beans
> returned
> all has a Max
> value returned. However, -1 is allowed by spec when Max
> is not
> set for
> the bean, and
> other jdk might return.
>
> In the patch, max is set to 1m or the max memory
> usage in
> history
> for the bean
> if there is no max specified. Please take a look.
>
> Bug:
> http://bugs.sun.com/____bugdatabase/view_bug.do?bug_____id=7173044
> <http://bugs.sun.com/__bugdatabase/view_bug.do?bug___id=7173044>
> <http://bugs.sun.com/__bugdatabase/view_bug.do?bug___id=7173044
> <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7173044>>
> Webrev:
> http://cr.openjdk.java.net/~____zhouyx/7173044/webrev.01/
> <http://cr.openjdk.java.net/~__zhouyx/7173044/webrev.01/>
>
> <http://cr.openjdk.java.net/~__zhouyx/7173044/webrev.01/
> <http://cr.openjdk.java.net/~zhouyx/7173044/webrev.01/>> .
>
>
> --
> Best Regards,
> Sean Chou
>
>
>
>
> --
> Best Regards,
> Sean Chou
>
>
>
>
> --
> Best Regards,
> Sean Chou
>
>
>
>
> --
> Best Regards,
> Sean Chou
>
More information about the serviceability-dev
mailing list