Skip to content

Commit

Permalink
move extra gc into clean func.
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Feb 7, 2024
1 parent 65044aa commit 567f498
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests_mem/testutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def clear_mem():
if is_pypy:
gc.collect()

device = wgpu.utils.get_default_device()
device._poll()
wgpu.utils.get_default_device()._poll()

gc.collect()


def get_counts():
Expand Down Expand Up @@ -190,9 +191,7 @@ def core_test_func():
assert ob_name == cls.__name__[3:]

# Give wgpu some slack to clean up temporary resources
gc.collect() # removes the additional CommandEncoder and Textures
wgpu.utils.get_default_device()._poll()
gc.collect() # removes the additional CommandBuffer
clear_mem()

# Measure peak object counts
counts2 = get_counts()
Expand Down

0 comments on commit 567f498

Please sign in to comment.