public long getSectionSize(final long address) {
    m_readLock.lock();

    final long start = getSectionStart(address);

    try {
      if (hasData(start, 1)) {
        MemoryChunk chunk = findChunk(start);

        long accusize = 0;

        do {
          if (!hasData(chunk.getAddress() + chunk.getLength(), 1)) {
            return (int) (accusize + chunk.getLength());
          } else {
            accusize += chunk.getLength();
            chunk = findChunk(chunk.getAddress() + chunk.getLength());
          }
        } while (true);
      } else if (m_chunks.size() == 0) {
        return 0x100000000L;
      } else {
        final MemoryChunk chunk = new MemoryChunk(start, 1);

        final int cpos = findChunkPosition(chunk);

        if (cpos == m_chunks.size()) {
          final MemoryChunk lc = m_chunks.get(cpos - 1);
          return 0x100000000L - lc.getAddress() - lc.getLength();
        } else {
          return m_chunks.get(cpos).getAddress() - start;
        }
      }
    } finally {
      m_readLock.unlock();
    }
  }
Returns the number of memory chunks in memory.

@return The number of memory chunks in memory.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/memmanager/Memory.java