Fwd: Request for review: 7173044: Memory monitor demo hangs if MemoryUsage obj returns -1 in getMax
Sean Chou
zhouyx at linux.vnet.ibm.com
Sun Jun 3 23:20:34 PDT 2012
Thanks David. Do I need one more reviewer to support as it is a
modification to demo ?
On Mon, Jun 4, 2012 at 1:55 PM, David Holmes <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 <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 <zhouyx at linux.vnet.ibm.com>>
>> <mailto:zhouyx at linux.vnet.ibm.**__com
>> <mailto:zhouyx at linux.vnet.ibm.**com <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@**openjdk.java.net<serviceability-dev at openjdk.java.net>
>> >
>> <mailto:serviceability-dev at __o**penjdk.java.net<http://openjdk.java.net>
>>
>> <mailto:serviceability-dev@**openjdk.java.net<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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20120604/76609640/attachment-0001.html
More information about the serviceability-dev
mailing list