Home Image-Pro Plus General Discussions

How can I reduce [managed memory usage] ?

Hi guys,
We developed a macro  for image batch analysis on IP-10 version 10.0.7.

The content of the macro is roughly [Open Image],[Apply Calibration] ,[Use 2D Filter], [Count], [Mask New Image], etc.

The images are all set to [visible=false], and after each image is counted, it will be closed.
Follow : https://forums.mediacy.com/discussion/709/batch-processing-limitations

At the beginning, it takes about 2 seconds to analyze an image, and after a while, it takes about 10 seconds for an image, and the [managed memory usage] cannot be reduced.

After testing, I found that the memory accumulate in [Apply Calibration], [Duplicate], [CreakMask], etc.
So I wrote a simple macro test.

[Apply Calibration]:


After processing 14 images:

What should I add to the macro to reduce the usage rate of [managed memory usage]?
Attached is the simple test macro.



  • Options

    Kyle1996 --

    I have never understood the benefits of the SIMPLESCRIPT feature in IMAGE-PRO.

    The existence of SIMPLESCRIPT routines in MODULES and APPS has sometimes bitten me because they seem to want to run whenever an image is opened by IMAGE-PRO.

    Normally I rip the references required by SIMPLE SCRIPT and make the routines only active when I call them specifically.

    I do this by removing the

        As SimpleScript

    from the routine declaration and by changing the reference to the ROUTINE in the code (ex "_2D_FILTERS") to "NOTHING" within the CODE like

        With Process.Filter.MorphologicalCommands.Close(Nothing)

    To understand the difference, you might want to put a DEBUG.PRINT into the routines before you make the change to see when they are being triggered.

    I think you will find that a

        DEBUG.PRINT "Hello from _2D_FILTERS"
        DEBUG.PRINT ThisApplication.ActiveDocument.DisplayName

    after the PUBLIC FUNCTION statement shows that it is running more often than you expect.

    I hope this information is helpful.

    Please let us know.

    -- Matt

Sign In or Register to comment.