-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
300GB of diskcache #64
Comments
+1 |
+1 Also having this problem. |
Cache Size Control SolutionWhen creating a composition, you can override the default cache behavior to control both the cache directory location and size limit. This helps prevent excessive disk space usage during video rendering. Solutionfrom diskcache import Cache
composition = mv.layer.Composition(size=(width, height), duration=duration)
composition._cache = Cache(
size_limit=1024 * 1024 * 1024, # 1GB limit
directory="custom_cache_dir"
) Usage Exampleclass VideoScene:
def __init__(self):
self.cache_dir = "cache"
self.cache_size = 1024 * 1024 * 1024 # 1GB
def cleanup(self):
# Clean up cache after rendering
if os.path.exists(self.cache_dir):
shutil.rmtree(self.cache_dir)
def render(self):
try:
composition = mv.layer.Composition(...)
composition._cache = Cache(
size_limit=self.cache_size,
directory=self.cache_dir
)
# ... render video ...
finally:
self.cleanup() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the
Composition
layer never callscull
method to enforce the size limit fordiskcache
.There is also no mechanism to clean up the cache after a long development which often results in hundred of GB of diskcache locally.
The text was updated successfully, but these errors were encountered: