Search in sources :

Example 1 with MemoryKind

use of com.intellij.diagnostic.VMOptions.MemoryKind in project intellij-community by JetBrains.

the class DefaultIdeaErrorLogger method handle.

@Override
public void handle(IdeaLoggingEvent event) {
    if (ourLoggerBroken)
        return;
    try {
        Throwable throwable = event.getThrowable();
        final MemoryKind kind = getOOMErrorKind(throwable);
        if (kind != null) {
            ourOomOccurred = true;
            SwingUtilities.invokeAndWait(() -> new OutOfMemoryDialog(kind).show());
        } else if (throwable instanceof MappingFailedException) {
            processMappingFailed(event);
        } else if (!ourOomOccurred) {
            MessagePool messagePool = MessagePool.getInstance();
            messagePool.addIdeFatalMessage(event);
        }
    } catch (Throwable e) {
        String message = e.getMessage();
        //noinspection InstanceofCatchParameter
        if (message != null && message.contains("Could not initialize class com.intellij.diagnostic.MessagePool") || e instanceof NullPointerException && ApplicationManager.getApplication() == null) {
            ourLoggerBroken = true;
        }
    }
}
Also used : MemoryKind(com.intellij.diagnostic.VMOptions.MemoryKind) MappingFailedException(com.intellij.util.io.MappingFailedException)

Aggregations

MemoryKind (com.intellij.diagnostic.VMOptions.MemoryKind)1 MappingFailedException (com.intellij.util.io.MappingFailedException)1