How to use index from old yacy?

I started getting errors when starting a crawl, they were saying nothing was found. Looked at the log and this was a warning.

E 2026/02/07 01:02:40 ConcurrentLog Java heap space
java.lang.OutOfMemoryError: Java heap space
	at net.yacy.kelondro.index.RowCollection.ensureSize(RowCollection.java:276)
	at net.yacy.kelondro.index.RowCollection.addUnique(RowCollection.java:425)
	at net.yacy.kelondro.index.RowCollection.addUnique(RowCollection.java:403)
	at net.yacy.kelondro.index.RAMIndex.addUnique(RAMIndex.java:216)
	at net.yacy.kelondro.index.RAMIndexCluster.addUnique(RAMIndexCluster.java:133)
	at net.yacy.kelondro.index.RowHandleMap.<init>(RowHandleMap.java:114)
	at net.yacy.kelondro.blob.HeapReader.initIndexReadDump(HeapReader.java:179)
	at net.yacy.kelondro.blob.HeapReader.<init>(HeapReader.java:91)
	at net.yacy.kelondro.blob.HeapModifier.<init>(HeapModifier.java:58)
	at net.yacy.kelondro.blob.ArrayStack.<init>(ArrayStack.java:209)
	at net.yacy.kelondro.rwi.ReferenceContainerArray.<init>(ReferenceContainerArray.java:68)
	at net.yacy.kelondro.rwi.IndexCell.<init>(IndexCell.java:99)
	at net.yacy.search.index.Segment.connectRWI(Segment.java:162)
	at net.yacy.search.Switchboard.<init>(Switchboard.java:578)
	at net.yacy.yacy.startup(yacy.java:215)
	at net.yacy.yacy.main(yacy.java:832)

So I just tried with a new install, and it opened fine until I tried putting my old INDEXfolder into the new installation, then I started getting this error again. Is this fixable? Is there any way I can use the index I had? Because I do not need to reindex everything AGAIN.

Edit: Forgot to mention I did try adjusting the ram to 3072mb which failed.

Hi How big is your old index?
You need to allocate ~2-3 GB of memory per one million documents.

I allocated 4096mb of ram and it worked. I was initially getting more errors which made me think it failed but after a few minutes it turned on like normal. I have 2mil documents, so ill probably need to give it more soon. But does this mean we have to stop indexing after a fixed amount of documents, when we run out of ram to give it? Because that would suck.

there are two indexes in yacy, lucene/solr and RWI. RWI is something what occupies quite a lot of ram and is used only for P2P distribution and search.
if in trouble, you can safely delete / reduce RWIs to get smaller memory footprint.
see RWI Index distribution in YaCy in docs for details.