// ignore the first line - description about the file itself
reader.readLine();
int line = 0;
String strMessage = null;
BulkAdd bulkAdd = this.references.createBulkAdd();
MemoryReference referenceTmp = new MemoryReference();
while ((strMessage = reader.readLine()) != null) {
if ((line++) % 50000 == 0) {
System.out.println("Read " + line + " references, maxMemory= " + Runtime.getRuntime().maxMemory() + ", freeMemory=" + Runtime.getRuntime().freeMemory() + " current=" + Runtime.getRuntime().totalMemory());
}
String split[] = strMessage.split(",");
long referencer = 0;
long referenced = 0;
boolean isThread = false;
if (split[0].startsWith("Thread")) {
referencer = Long.parseLong(split[0].substring(6));
//System.out.println(split[0] + " was converted into " + referencer);
isThread = true;
} else {
referencer = Long.parseLong(split[0]);
}
referenced = Long.parseLong(split[1]);
referenceTmp.setReferee(referencer);
referenceTmp.setReferred(referenced);
referenceTmp.setThreadReference(isThread);
bulkAdd.add(referenceTmp);
}
bulkAdd.close();
/*for (int i=0;i<5000;i++)
{
MemoryReference ref =(MemoryReference) this.references.get(i);
System.out.println("ref = " + ref);