Get_binary_data memory leak

General Information

  • Product: e.g. Ensenso SDK
  • Serial Number: 244034
  • Ensenso SDK Version: 4.1.1033
  • Operating System:
    Windows
  • Data Attachments?
    nx_simple_adj.py (854 Bytes)

Problem / Question

Hi,

When running attached python script, the memory usage is steadily increasing. Culprit is the get_point_map() command. How can I clear the memory every iteration?

Thanks in advance!

Bart

Hi Bart,

sorry for the late reply. I have been able to reproduce the increasing memory usage and am currently investigating it. I`ll keep you posted.

Kind regards
Benny

The allocated memory areas for the point clouds (pcloud variable in the Python script) will be freed eventually by the garbage collector. That is what I observed on my machine. Can you confirm this?

In Python you cannot really deallocate the memory yourself. You could call del pcloud, but this will still leave it to the garbage collector to free the unreachable object somewhere in the future.

You can, however, invoke a garbage collection manually by running:

import gc

num_of_collected_objects = gc.collect()

Let me know if you have any further questions.

Kind regards
Benny

Hi Benny,

On my machine memory usage seems to be running up continuously with the process taking up ofter 6Gb after 150 iterations.
With manual garbage collect however, the memory usage stays low, so this seems to solve it.

Thanks!