Running out of memory with comdet

I am trying to create a macro to do spot co-localization between two channels. I am using comdet, and here is my macro (using code from the imageJ macro tutorial):

dir1 = getDirectory("Choose Source Directory ");
dir2 = getDirectory("Choose Destination Directory ");
list = getFileList(dir1);
setBatchMode(true);
for (i=0; i<list.length; i++) {
showProgress(i+1, list.length);
open(dir1+list[i]);

run("Delete Slice", "delete=channel");

run(“Subtract Background…”, “rolling=6 stack”);
run(“Detect Particles”, “calculate max=8 rois=Ovals add=Nothing summary=Append ch1i ch1l ch1a=6 ch1s=20 ch2i ch2l ch2a=6 ch2s=20”);

saveAs("TIFF", dir2+list[i]);

close("*"); }

My issue is that as its going through, some pictures seem to trip up my computer. I get the following error:

Exception in thread “Thread-1822” java.lang.OutOfMemoryError: Java heap space
at fiji.plugin.ComDet.CDAnalysis.getThreshold(CDAnalysis.java:657)
at fiji.plugin.ComDet.CDAnalysis.detectParticles(CDAnalysis.java:99)
at fiji.plugin.ComDet.CDThread.run(Detect_Particles.java:1058)
Exception in thread “Thread-1854” java.lang.OutOfMemoryError: Java heap space
at fiji.plugin.ComDet.CDAnalysis.getThreshold(CDAnalysis.java:657)
at fiji.plugin.ComDet.CDAnalysis.detectParticles(CDAnalysis.java:99)
at fiji.plugin.ComDet.CDThread.run(Detect_Particles.java:1058)

This error would come up every time the process reached the same picture, so I took the picture out of the folder and increased the memory limit to 12GB for FIJI. Now, I get this error again when the process gets to a different picture (far further along) in the folder.

Anybody know what to do?
Are there any plugins to colocalize spots that have been around longer? I tried coloc2 but that just looks at overlap, not the number of spots within a certain distance of each other.

Bonus: does anybody know how to make it save each result as a file or maybe put the name of the file next to each measurement?