PyMeshLab
PyMeshLab copied to clipboard
Memory Leak get_hausdorff_distance?
Hello,
Thanks for this awesome library. We're using it to do some mesh processing. We have some issues using hausdorff distance. The script keeps increasing used memory, without any drop. We suspect some memory leak, here the code. Do you have any clue?
@profile
def cal_dist(path1, path2):
ms = pymeshlab.MeshSet()
ms.load_new_mesh(path1)
ms.load_new_mesh(path2)
res_dict = ms.apply_filter('get_hausdorff_distance', targetmesh=1, sampledmesh=0, maxdist=pymeshlab.Percentage(100), samplevert=True)
ms.clear()
del ms
r = res_dict['RMS']
return r
objs = collect_obj_name("./dataset/perf_test")
for i in range(500):
i1 = math.floor(random.random()*len(objs))
i2 = math.floor(random.random()*len(objs))
# print(i1, i2)
d = cal_dist(objs[i1], objs[i2])
# print(d)
The used memory has a peak at ~200mb (monotonically increasing).
Thanks.
Hi, sorry for the late reply. Are your meshes obj files? I can confirm memory leaks, but they are related to the obj loader and not to the hausdorff distance computation.
Hi Ale, don't worry.
Yep, the meshes are obj files. Thanks for the reply.