You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though this is PyMeshLab, the leak is likely in the main repository.
Repro script:
import os
import numpy as np
import psutil
import pymeshlab as pm
from memory_profiler import profile
NUM_THREADS = 8
NUM_ITERATIONS = 20
def generate_sphere_point_cloud(radius=1.0, num_points=100000):
theta = np.random.uniform(0, 2 * np.pi, num_points)
phi = np.random.uniform(0, np.pi, num_points)
x = radius * np.sin(phi) * np.cos(theta)
y = radius * np.sin(phi) * np.sin(theta)
z = radius * np.cos(phi)
points = np.vstack((x, y, z)).T
return points
def print_memory_usage(process):
mem_info = process.memory_info()
print(
"MEMORY USAGE: "
f"RSS={mem_info.rss / (1024 * 1024):.2f} MB, "
f"VMS={mem_info.vms / (1024 * 1024):.2f} MB"
)
# @profile
def poisson(points):
ms = pm.MeshSet()
m = pm.Mesh(points)
ms.add_mesh(m, "sphere")
ms.compute_normal_for_point_clouds(k=20)
ms.generate_surface_reconstruction_screened_poisson(
depth=9, pointweight=0, samplespernode=5, cgdepth=9, threads=NUM_THREADS
)
m = ms.current_mesh()
ms.clear()
ms.clear_filter_script()
def test_memory_leak():
process = psutil.Process(os.getpid())
points = generate_sphere_point_cloud()
for _ in range(NUM_ITERATIONS):
print_memory_usage(process)
poisson(points)
print_memory_usage(process)
if __name__ == "__main__":
test_memory_leak()
The text was updated successfully, but these errors were encountered:
eskjorg
changed the title
memory leak in generate_surface_reconstruction_screened_poisson -- pymeshlab==2023.12.post2
memory leak in generate_surface_reconstruction_screened_poisson() -- pymeshlab==2023.12.post2
Nov 20, 2024
Ubuntu 22.04.4 LTS
python==3.11
pymeshlab=='2023.12.post2'
numpy=='1.26.4'
Though this is PyMeshLab, the leak is likely in the main repository.
Repro script:
The text was updated successfully, but these errors were encountered: