lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (LUCENE-5673) MmapDirectory shouldn't pass along OOM wrapped as IOException
Date Fri, 16 May 2014 11:24:29 GMT


Uwe Schindler commented on LUCENE-5673:

this is indeed a problem. The existence of the OOM somewhere in the stack trace confuses users,
because whenever they see OOM, they start to raise -Xmx and by that make the problem worse.
The behaviour is correct from the API, because the javadocs of specify that
it throws IOException when mapping fails. But the implementation in OpenJDK is bullshit:
We should do something like this:

...catch (IOException ioe) {
  if (ioe.getCause() instanceof OutOfMemoryError) {
    throw new IOException("Memory mapping failed. There might not be enough unfragmented address
space available to mmap the index file: " + ioe.getCause().getMessage()); // without root
  throw ioe;

By that the user just gets a good IOException not referring to OOM.

Indeed the OOM is the real bug, because its caused by OutOfAddressSpaceError and not OutOfMemoryError

> MmapDirectory shouldn't pass along OOM wrapped as IOException
> -------------------------------------------------------------
>                 Key: LUCENE-5673
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-5673.patch
> The bug here is in java (not MMapDir), but i think we shoudl do something.
> Users get confused when they configure their JVM to trigger something on OOM, and then
see "OutOfMemoryError: Map Failed": but their trigger doesnt fire.
> Thats because in the jdk, when it maps files it catches OutOfMemoryError, asks for a
garbage collection, sleeps for 100 milliseconds, then tries to map again. if it fails a second
time it wraps the OOM in a generic IOException.
> I think we should add a try/catch to our

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message