code: private void loadIndexInMemory() throws Exception {
  		long start = System.currentTimeMillis();
  		System.out.println("Loading persistent index in memory.");
  
  		DatabaseEntry foundKey = new DatabaseEntry();
  		DatabaseEntry foundData = new DatabaseEntry();
  
  		ForwardCursor cursor = null;
  		if (useDiskOrderedCursor) { // disk ordered cursor
  			DiskOrderedCursorConfig docc = new DiskOrderedCursorConfig();
  			cursor = iidToVectorDB.openCursor(docc);
  		} else {
  			cursor = iidToVectorDB.openCursor(null, null);
  		}
  
  		int counter = 0;
  		while (cursor.getNext(foundKey, foundData, null) == OperationStatus.SUCCESS
  				&& counter < maxNumVectors) {
  			TupleInput input = TupleBinding.entryToInput(foundData);
  			double[] vector = new double[vectorLength];
  			for (int i = 0; i < vectorLength; i++) {
  				vector[i] = input.readDouble();
  			}
  			// update ram based index
  			vectorsList.add(vector);
  			counter++;
  			if (counter % 1000 == 0) {
  				System.out.println(counter + " vectors loaded in memory!");
  			}
  		}
  		cursor.close();
  		long end = System.currentTimeMillis();
  		System.out.println(counter + " vectors loaded in " + (end - start) + " ms!");
  	}
docs: Loads the persistent index in memory.
  
  @throws Exception