[ 
https://issues.apache.org/jira/browse/CASSANDRA-15214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17100193#comment-17100193
 ] 

Yifan Cai commented on CASSANDRA-15214:
---------------------------------------

Got it. I did not look closely enough at the discussions in  CASSANDRA-13006. 

I agree that leaving it to JVM is a more clean and general solution. Also as 
you mentioned, "It's relatively easy to ignore the "sacrificial" long array in 
a heap dump and we could log clearly what is happening."

Since one should be able to trigger the OOM by looping allocating large chunk 
of memory, e.g. array, in the java code. What is the benefit of doing it so 
using jvmquake? I can see that in the killer_thread callback function, it also 
does long array allocation once notified by the gc callback. 

The comment of the callback says
{quote}the only way to reliably trigger OutOfMemory
 when we are not actually out of memory (e.g. due to GC behavior) that I
 could find was to make JNI calls that allocate large blobs of memory which
 can only be done from outside of the GC callbacks.
{quote}
Can you elaborate more about preferring jvmquake? 

> OOMs caught and not rethrown
> ----------------------------
>
>                 Key: CASSANDRA-15214
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15214
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Messaging/Client, Messaging/Internode
>            Reporter: Benedict Elliott Smith
>            Priority: Normal
>             Fix For: 4.0, 4.0-rc
>
>         Attachments: oom-experiments.zip
>
>
> Netty (at least, and perhaps elsewhere in Executors) catches all exceptions, 
> so presently there is no way to ensure that an OOM reaches the JVM handler to 
> trigger a crash/heapdump.
> It may be that the simplest most consistent way to do this would be to have a 
> single thread spawned at startup that waits for any exceptions we must 
> propagate to the Runtime.
> We could probably submit a patch upstream to Netty, but for a guaranteed 
> future proof approach, it may be worth paying the cost of a single thread.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to