Skip to content
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

Explore more appropriate memory management that doesn't involve calling gc() #141

Closed
cjyetman opened this issue Feb 16, 2024 · 4 comments
Closed

Comments

@cjyetman
Copy link
Member

          Approving as a "fine if we HAVE to" approval. And on the condition that we open a new issue to further explore a better way to get memory use within a reasonable limit. 

There has to be a better way! But agree that this is an effective band-aid for now.

Originally posted by @jdhoffa in #140 (review)

@jdhoffa jdhoffa changed the title manage memory better Explore more appropriate memory management that doesn't involve calling gc() Feb 16, 2024
@cjyetman
Copy link
Member Author

for the record, @cjyetman does not believe that using gc() is necessarily a bad thing to do

@jdhoffa
Copy link
Member

jdhoffa commented Feb 16, 2024

Maybe not!

My reaction to it may just be because I am not used to it or seeing that done in PROD elsewhere, not strictly a reaction to it fundamentally

@AlexAxthelm
Copy link
Collaborator

My reaction to it is that it's a pretty clear code smell. If you're running close enough to the edge that auto-collection isn't cutting it, then it's probably time to explore other options (this ticket!)

@cjyetman
Copy link
Member Author

I think the idea here is that use of gc() implies a misuse of memory, e.g. making numerous, unnecessary large objects that need to be managed. The reality is that we have numerous large objects that need to be loaded, and we've already put a lot of effort into only loading them when needed, and getting rid of them once they're no longer needed, and now running gc() immediately after they've been removed to force R to clean up after them immediately, which imo is proper usage. Closing this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants