[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-serviceability-dev
Subject: RE: OOM counters
From: "Baesken, Matthias" <matthias.baesken () sap ! com>
Date: 2018-09-21 15:19:19
Message-ID: VI1PR02MB4384D65F53F5480E2EF9B17893120 () VI1PR02MB4384 ! eurprd02 ! prod ! outlook ! com
[Download RAW message or body]
[Attachment #2 (text/plain)]
>
> Sorry, when I said "we added" I meant "in our internal JDK at Google" :-); not the \
> OpenJDK one. But basically, from what I can tell when I look at the code; when an \
> OOM happens, we get a callback and do some book-keeping in native land before \
> returning and letting the JVM close up shop.
HI JC, that sounds interesting and in case it is better than what we have at the \
moment in OpenJDK , it is interesting for us too .
From my understanding we have already some kind of callbacks in the present OpenJDK \
for handling the OOMs :
* the XX flags ExitOnOutOfMemoryError and OnOutOfMemoryError=<command> : \
this is in the hotspot code , however this is a bit limited because it limits you \
to exit, or call an external shell script/command via fork
* JVMTI (haven't looked into the details, but I think you would need to code a \
JVM agent – not an option in some use cases)
The use case our customers have and you asked about is more or less like what you \
describe in your first scenario . They check in some cycle for OOM , then do \
some tracing maybe cleanup and exit . For this , they can use the eventqueue of \
our SAP-internal JDK .
Best regards, Matthias
From: JC Beyler <jcbeyler@google.com>
Sent: Freitag, 21. September 2018 16:59
To: Baesken, Matthias <matthias.baesken@sap.com>
Cc: David Holmes <david.holmes@oracle.com>; serviceability-dev@openjdk.java.net
Subject: Re: OOM counters
Sorry, when I said "we added" I meant "in our internal JDK at Google" :-); not the \
OpenJDK one. But basically, from what I can tell when I look at the code; when an OOM \
happens, we get a callback and do some book-keeping in native land before returning \
and letting the JVM close up shop.
I had plans of also finding out if there is interest in pushing this forward and \
upstream for the community so: anyone can chime in now and say: yes this would be \
interesting to have.
Note: I'm not saying this is better than what you have; I just don't fully comprehend \
your use-case. An API to inspect those counters seems weird to me: when would you \
actually use it to see the counters are not 0? The only two cases I can see is that \
you either:
- The OOM happened and you caught it via a catch, now you go and look at the counters \
in Java land before the JVM will close up shop and do something with that \
information; seems weird to be doing things at an OOM in Java land \
but why not :)
- The OOM happened, you caught it via a catch; but your setup is such that you can \
survive an OOM and thus logging why an OOM happened is interesting; as the jobs keep \
surviving OOMs, you can actually track why OOMs happened
But perhaps I'm missing something :), my knowledge and understanding of OOMs (and let \
us be honest of actual Java land) is fairly limited :-) Jc
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1157842169;
mso-list-template-ids:-1554751246;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:72.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:108.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:144.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:180.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:216.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:252.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:288.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:324.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1
{mso-list-id:1717314721;
mso-list-type:hybrid;
mso-list-template-ids:984374380 571244498 67567619 67567621 67567617 67567619 \
67567621 67567617 67567619 67567621;} @list l1:level1
{mso-level-start-at:2;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-font-family:Calibri;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US">> Sorry, when I said "we added" I \
meant "in our internal JDK at Google" :-); not the OpenJDK one. But \
basically, from what I can tell when I look at the code; when an OOM happens, \
<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US">> we get a callback \
and do some book-keeping in native land before returning and letting the JVM close up \
shop.<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US">><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">HI JC, \
that sounds interesting and in case it is better than what we have at the \
moment in OpenJDK , it is interesting for us too .<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">From my \
understanding we have already some kind of callbacks in the present OpenJDK for \
handling the OOMs :<o:p></o:p></span></p> <ul style="margin-top:0cm" type="disc">
<li class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo2"><span \
lang="EN-US" style="mso-fareast-language:EN-US">the XX flags </span><span \
lang="EN-US">ExitOnOutOfMemoryError and \
OnOutOfMemoryError=<command> </span><span lang="EN-US" \
style="mso-fareast-language:EN-US"> : this is in the \
hotspot code , however this is a bit limited because it limits you to \
exit, or call an external shell script/command via fork</span><span \
lang="EN-US" style="mso-fareast-language:EN-US"><o:p></o:p></span></li><li \
class="MsoListParagraph" style="margin-left:0cm;mso-list:l1 level1 lfo2"><span \
lang="EN-US" style="mso-fareast-language:EN-US">JVMTI (haven't looked \
into the details, but I think you would need to code a JVM agent – not an option in \
some use cases)</span><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p></o:p></span></li></ul> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">The use \
case our customers have and you asked about is more or less like what you \
describe in your first scenario .<o:p></o:p></span></p> <p class="MsoNormal"><span \
lang="EN-US">They check in some cycle for OOM , then do \
some tracing maybe cleanup and exit .<o:p></o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">For \
this , they can use the eventqueue of our SAP-internal JDK . \
<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Best regards, \
Matthias<o:p></o:p></span></p> <p class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <p \
class="MsoNormal"><span lang="EN-US" \
style="mso-fareast-language:EN-US"><o:p> </o:p></span></p> <div \
style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"> <div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> JC \
Beyler <jcbeyler@google.com> <br>
<b>Sent:</b> Freitag, 21. September 2018 16:59<br>
<b>To:</b> Baesken, Matthias <matthias.baesken@sap.com><br>
<b>Cc:</b> David Holmes <david.holmes@oracle.com>; \
serviceability-dev@openjdk.java.net<br> <b>Subject:</b> Re: OOM \
counters<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Sorry, when I said "we added" I meant "in our \
internal JDK at Google" :-); not the OpenJDK one. But basically, from what I can \
tell when I look at the code; when an OOM happens, we get a callback and do some \
book-keeping in native land before returning and letting the JVM close up \
shop.<o:p></o:p></p> <div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I had plans of also finding out if there is interest in pushing \
this forward and upstream for the community so: anyone can chime in now and say: yes \
this would be interesting to have.<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Note: I'm not saying this is better than what you have; I just \
don't fully comprehend your use-case. An API to inspect those counters seems weird to \
me: when would you actually use it to see the counters are not 0? The only two cases \
I can see is that you either:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">- The OOM happened and you caught it via a catch, now you go and \
look at the counters in Java land before the JVM will close up shop and do something \
with that information; seems weird to be doing things at an OOM in Java land but why \
not :)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- The OOM happened, you caught it via a catch; but your setup is \
such that you can survive an OOM and thus logging why an OOM happened is interesting; \
as the jobs keep surviving OOMs, you can actually track why OOMs \
happened<o:p></o:p></p> </div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">But perhaps I'm missing something :), my knowledge and \
understanding of OOMs (and let us be honest of actual Java land) is fairly limited \
:-)<o:p></o:p></p> </div>
<div>
<p class="MsoNormal">Jc<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic