!759 static int maxPixels = 6*1000*1000; static long pixels; p { conceptsAndBot(60*1000); // auto-save every minute awt { showControls(jcenteredLine(jbutton("Show grabbed images", r { nohupJavax("#1005971") }))); } while licensed { printFullHeapSizeWithGC(); long time = now(); AutoShootInfo info = autoShoot(); pixels = totalPixelCount(collect(list(GrabbedImage), "image")); long singlePixels = totalPixelCount(collect(conceptsWhere(GrabbedImage, count := 1), "image")); done_always(time, "Seeing " + n(l(info.segments), "things") + ", " + info.considered + " in right size, now " + n(countConcepts(GrabbedImage), "image") + " in store, " + toM(pixels) + "M pixels (" + toM(singlePixels) + "M seen only once)"); slimDB(); sleepSeconds(10); } } svoid slimDB { if (pixels > maxPixels) { int n = 0; for (GrabbedImage gi : sortByField(list(GrabbedImage), "count")) { pixels -= totalPixelCount(gi.image); gi.delete(); ++n; if (pixels <= maxPixels) break; } print(" Deleted " + n(n, "images") + " to get below threshold of " + toM(maxPixels) + "M pixels."); } }