Github user vanzin commented on the pull request:
https://github.com/apache/spark/pull/1387#issuecomment-48958962
As it has been said, there is no guarantee that `System.gc()` does
anything, much less that it does it synchronously as the code (sort of)
assumes. Also, see ExecutorRunnableUtil.scala:
val commands = Seq(Environment.JAVA_HOME.$() + "/bin/java",
"-server",
// Kill if OOM is raised - leverage yarn's failure handling to cause
rescheduling.
// Not killing the task leaves various aspects of the executor and
(to some extent) the jvm in
// an inconsistent state.
// TODO: If the OOM is not recoverable by rescheduling it on
different node, then do
// 'something' to fail job ... akin to blacklisting trackers in
mapred ?
"-XX:OnOutOfMemoryError='kill %p'") ++
So even if this worked, it wouldn't do anything in Yarn mode. Also, there
is no guarantee that the VM will be able to run your code after an OOM occurs.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---