Focused crawls are collections of frequently-updated webcrawl data from narrow (as opposed to broad or wide) web crawls, often focused on a single domain or subdomain.
//Example of how to set custom config.
public void customConfig() {
KConfig kConfig = new KConfig.KConfigBuilder()
.heapRatio(85.0f) //heap occupied ration in percent, 85.0f means use 85% memory of max heap
.rootDir(this.getCacheDir().getAbsolutePath()) //root dir stores report and hprof files
.heapOverTimes(3) //heap max times of over heap's used threshold
.build();
KOOM.getInstance().setKConfig(kConfig);
}
Setting custom logger
//Example of how to set custom logger.
public void customLogger() {
KOOM.getInstance().setLogger(new KLog.KLogger() {
@Override
public void i(String TAG, String msg) {
//get the log of info level
}
@Override
public void d(String TAG, String msg) {
//get the log of debug level
}
@Override
public void e(String TAG, String msg) {
//get the log of error level
}
});
}
Manually Dump Hprof
//Example of dump hprof directly
public void customDump() {
//Same with StandardHeapDumper StripHprofHeapDumper
new ForkJvmHeapDumper().dump("absolute-path");
}