mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
try to get a fix for OOM problem in case that there is no real problem with missing memory.
See also http://forum.yacy-websuche.de/viewtopic.php?p=19835#p19835 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6802 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
parent
70e6222978
commit
aa083fc45c
|
@ -234,7 +234,15 @@ public class RowCollection implements Iterable<Row.Entry> {
|
|||
System.arraycopy(chunkcache, 0, newChunkcache, 0, chunkcache.length);
|
||||
chunkcache = newChunkcache;
|
||||
} catch (OutOfMemoryError e) {
|
||||
throw new RowSpaceExceededException(allocram, "RowCollection grow after OutOfMemoryError " + e.getMessage());
|
||||
// lets try again after a forced gc()
|
||||
System.gc();
|
||||
try {
|
||||
final byte[] newChunkcache = new byte[(int) allocram]; // increase space
|
||||
System.arraycopy(chunkcache, 0, newChunkcache, 0, chunkcache.length);
|
||||
chunkcache = newChunkcache;
|
||||
} catch (OutOfMemoryError ee) {
|
||||
throw new RowSpaceExceededException(allocram, "RowCollection grow after OutOfMemoryError " + ee.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user