Windows handle error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Windows handle error

Curry, Nathan

Dear all,

During long acquisitions I am encountering the error “The current process has used all of its system allowance of handles for Window Manager objects.” After acquiring a large number (~10 000) images. It appears that micromanager is retaining a handle pointing to each file saved during the acquisition. A test script which leads to this problem is below and has been tested on version 1.4 (yesterdays nightly build). Any comments appreciated.

Nathan

 

// User settings

mainSavePath = "E:/Test/";

String camera = "pco_camera";

String acquisition = "acq_str";

exposureReflect_ms       = 2;

nImages = 3;

mmc.stopSequenceAcquisition(camera); //stop in MM

// Set up camera + buffer

mmc.setCameraDevice(camera);

                w = (int) mmc.getImageWidth();

                h = (int) mmc.getImageHeight();

                d = (int) mmc.getBytesPerPixel();

                imageBitDepth = (int) mmc.getImageBitDepth();

mmc.setExposure(exposureReflect_ms);

mmc.initializeCircularBuffer();

 

nRun = 300000;

 

nFields = 2;

 

// Acquire time lapse

for (index = 0; index < nRun; index++) {

                for(f = 0; f < nFields; f++){            

                                gui.closeAllAcquisitions();           

                                System.gc();

                                imagePath = "run_" + index + "/field_" + f + "/";

                                mmc.setProperty(camera, "Triggermode","External");    // Camera externally triggered

                               

                                // prepare for sequence acquisition

                                gui.openAcquisition(acquisition, mainSavePath + imagePath, nImages, 1, 1, false, true);

                                gui.initializeAcquisition(acquisition, w, h, d, imageBitDepth);

                                mmc.prepareSequenceAcquisition(camera);

                                mmc.startSequenceAcquisition(camera,nImages,0,false);

                               

                                mmc.clearCircularBuffer();                         

                                counter = 0;

                               

                                //  acquire images

                                while(counter < nImages ) {

                                   if (mmc.getRemainingImageCount() > 0) {

                                                                img = mmc.popNextTaggedImage();       

                                                   camName = img.tags.getString("Camera");                                      

                                                                if (camName.equals(camera)) {

                                                                   gui.addImageToAcquisition(acquisition, counter, 0, 0,0,img);

                                                                  counter++;

                                                                };

                                                }

                                }

                               

                                // Stop acquisition

                                mmc.stopSequenceAcquisition(camera); //stop in MM

                                // Close acquisitions

                                gui.closeAcquisition(acquisition);

                }

}

 

 

--

--------------------------------------------------------------------------------------

PDRA | Biophotonics | Imperial College London

020 7594 7712 | [hidden email]

6.29  Blackett Laboratory | Imperial College London | SW7 2AZ

--------------------------------------------------------------------------------------

 

 



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Windows handle error

Stuurman, Nico
Hi Nathan,

> During long acquisitions I am encountering the error “The current
> process has used all of its system allowance of handles for Window
> Manager objects.” After acquiring a large number (~10 000) images. It
> appears that micromanager is retaining a handle pointing to each file
> saved during the acquisition. A test script which leads to this
> problem is below and has been tested on version 1.4 (yesterdays
> nightly build). Any comments appreciated.

I distinctly remember this error and fixing it (for 2.0-gamma), but I am
having trouble locating the actual commit this happened.

In any case, I would test this in 2.0-gamma, and I expect this to be a
non-issue in that version (and if it is and issue, I will fix it).

I don't think that anyone is maintaining 1.4 (except for the C++ layer),
but if anyone has a fix, I am happy to commit it to the source code
repository.

Best,


Nico




_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general