public boolean isInMemoryBounds(final int npaths, final boolean extend) {
//    long total = nodesCreated * 76L + linksCreated * 48L;
        long total = nodesCreated * 95L + npaths * 200L;

        if (extend) {
            total += 100000;

            // when extending, try to have 1 MB  space
            final long delta = total + 1900000 - currentmaxmem;
            if (delta > 0) {
                currentmaxmem += delta;
                if (currentmaxmem > maxmem) {
                    currentmaxmem = maxmem;
                }
            }
        }
        return total <= currentmaxmem;
    }
Container for link between two Osm nodes

@author ab
main/src/main/java/cgeo/geocaching/brouter/mapaccess/OsmNodesMap.java