System.gc();
	public void store(final NodeImpl node, CharSequence currentPath) {		// first, check available memory		if (nodesCount > MEM_LIMIT_CHECK) {			final int percent = (int) (run.freeMemory() / (run.totalMemory() / 100));			if (percent < memMinFree) {				LOG.info(					"total memory: " + run.totalMemory() + "; free: " + run.freeMemory());				flush();				System.gc();				LOG.info(					"total memory: " + run.totalMemory() + "; free: " + run.freeMemory());			}		}		final DocumentImpl doc = (DocumentImpl) node.getOwnerDocument();		final IndexPaths idx = (IndexPaths) idxPathMap.get(doc.getDoctype().getName());		final long gid = node.getGID();		if (gid < 0) {			LOG.debug("illegal node: " + gid + "; " + node.getNodeName());			Thread.dumpStack();			return;		}		final short nodeType = node.getNodeType();		final String nodeName = node.getNodeName();		// final String localName = node.getLocalName();		final int depth = idx == null ? defaultIndexDepth : idx.getIndexDepth();		new DOMTransaction(this, domDb, Lock.WRITE_LOCK) {			public Object start() throws ReadOnlyException {				long address = -1;				final byte data[] = node.serialize();				if (nodeType == Node.TEXT_NODE					|| nodeType == Node.ATTRIBUTE_NODE					|| doc.getTreeLevel(gid) > depth)					address = domDb.add(data);				else {					address = domDb.put(new NodeRef(doc.getDocId(), gid), data);				}				if (address < 0)					LOG.warn("address is missing");				node.setInternalAddress(address);				ByteArrayPool.releaseByteArray(data);				return null;			}		}		.run();		++nodesCount;		NodeProxy tempProxy = null;		QName qname;		switch (nodeType) {			case Node.ELEMENT_NODE :				tempProxy = new NodeProxy(doc, gid, node.getInternalAddress());				tempProxy.setHasIndex(idx == null || idx.match(currentPath));				// save element by calling ElementIndex				elementIndex.setDocument(doc);				elementIndex.addRow(node.getQName(), tempProxy);				break;			case Node.ATTRIBUTE_NODE :				tempProxy = new NodeProxy(doc, gid, node.getInternalAddress());				tempProxy.setHasIndex(idx == null || idx.match(currentPath));				qname =					new QName(						node.getLocalName(),						node.getNamespaceURI(),						node.getPrefix());				qname.setNameType(ElementValue.ATTRIBUTE);				elementIndex.setDocument(doc);				elementIndex.addRow(qname, tempProxy);				// check if attribute value should be fulltext-indexed				// by calling IndexPaths.match(path) 				if (idx == null					|| (idx.getIncludeAttributes()						&& idx.match(currentPath + "/@" + nodeName)))					textEngine.storeAttribute(idx, (AttrImpl) node);				// if the attribute has type ID, store the ID-value				// to the element index as well				if (((AttrImpl) node).getType() == AttrImpl.ID) {					qname = new QName(((AttrImpl) node).getValue(), "", null);					//LOG.debug("found ID: " + qname.getLocalName());					qname.setNameType(ElementValue.ATTRIBUTE_ID);					elementIndex.addRow(qname, tempProxy);				}				break;			case Node.TEXT_NODE :				// check if this textual content should be fulltext-indexed				// by calling IndexPaths.match(path)				if (idx == null || idx.match(currentPath))					textEngine.storeText(idx, (TextImpl) node);				break;		}	}