Author: orbiter
Date: 2008-01-22 21:44:12 +0100 (Tue, 22 Jan 2008)
New Revision: 4368
Modified:
trunk/htroot/Bookmarks.java
trunk/source/de/anomic/kelondro/kelondroEcoTable.java
Log:
- more logging
Modified: trunk/htroot/Bookmarks.java
===================================================================
--- trunk/htroot/Bookmarks.java 2008-01-22 20:19:34 UTC (rev 4367)
+++ trunk/htroot/Bookmarks.java 2008-01-22 20:44:12 UTC (rev 4368)
@@ -358,7 +358,7 @@
tag=(Tag) it.next();
if (tag.getFriendlyName().startsWith("/")) {
path = tag.getFriendlyName();
- while(!path.equals("")){
+ while(path.length() > 0){
folders.add(path);
path = path.replaceAll("(/.[^/]*$)",
"");
serverLog.logInfo("BOOKMARKS", "Path:
"+path+" added to folder list.\n");
Modified: trunk/source/de/anomic/kelondro/kelondroEcoTable.java
===================================================================
--- trunk/source/de/anomic/kelondro/kelondroEcoTable.java 2008-01-22
20:19:34 UTC (rev 4367)
+++ trunk/source/de/anomic/kelondro/kelondroEcoTable.java 2008-01-22
20:44:12 UTC (rev 4368)
@@ -102,9 +102,18 @@
((useTailCache == tailCacheForceUsage) ||
((useTailCache == tailCacheUsageAuto) &&
(serverMemory.request(neededRAM4table, false))))) ?
new kelondroRowSet(taildef, records) : null;
- System.out.println("*** DEBUG: available RAM: " +
(serverMemory.available() / 1024 / 1024) + "MB, allocating space for " +
records + " entries");
+ System.out.println("*** DEBUG " + tablefile + ": available RAM: "
+ (serverMemory.available() / 1024 / 1024) + "MB, allocating space for " +
records + " entries");
+ long neededRAM4index = 200 * 1024 * 1024 + records *
(rowdef.primaryKeyLength + 4) * 3 / 2;
+ if (!serverMemory.request(neededRAM4index, false)) {
+ // despite calculations seemed to show that there is enough
memory for the table AND the index
+ // there is now not enough memory left for the index. So
delete the table again to free the memory
+ // for the index
+ System.out.println("*** DEBUG " + tablefile + ": not enough
RAM (" + (serverMemory.available() / 1024 / 1024) + "MB) left for index,
deleting allocated table space to enable index space allocation (needed: " +
(neededRAM4index / 1024 / 1024) + "MB)");
+ table = null; System.gc();
+ System.out.println("*** DEBUG " + tablefile + ": RAM after
releasing the table: " + (serverMemory.available() / 1024 / 1024) + "MB");
+ }
index = new kelondroBytesIntMap(rowdef.primaryKeyLength,
rowdef.objectOrder, records);
- System.out.println("*** DEBUG: EcoTable " + tablefile.toString() +
" has table copy " + ((table == null) ? "DISABLED" : "ENABLED"));
+ System.out.println("*** DEBUG " + tablefile + ": EcoTable " +
tablefile.toString() + " has table copy " + ((table == null) ? "DISABLED" :
"ENABLED"));
// read all elements from the file into the copy table
byte[] record = new byte[rowdef.objectsize];
@@ -124,7 +133,7 @@
// check consistency
ArrayList<Integer[]> doubles = index.removeDoubles();
if (doubles.size() > 0) {
- System.out.println("DEBUG: WARNING - EcoTable " + tablefile +
" has " + doubles.size() + " doubles");
+ System.out.println("DEBUG " + tablefile + ": WARNING -
EcoTable " + tablefile + " has " + doubles.size() + " doubles");
}
} catch (FileNotFoundException e) {
// should never happen
_______________________________________________
YaCy-svn mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yacy-svn