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

Worker not releasing memory from Python process #283

Closed
mpinkerton-oasis opened this issue Dec 16, 2019 · 5 comments
Closed

Worker not releasing memory from Python process #283

mpinkerton-oasis opened this issue Dec 16, 2019 · 5 comments
Assignees
Labels
Projects

Comments

@mpinkerton-oasis
Copy link

mpinkerton-oasis commented Dec 16, 2019

The Python process seems to hold on to the memory used for generating the analysis inputs. This should be freed up, and in particular made available to the ktools model execution.

According to @ndaqjn this can be easilly verified with the PiWind model.

@sambles
Copy link
Contributor

sambles commented Dec 19, 2019

Just checked and it does seem to be leaking memory, this might be worth a try:
https://docs.python.org/3/library/tracemalloc.html

@mpinkerton-oasis
Copy link
Author

Note from @OmegaDroid
his came down to 3 issues,

  1. The billiard implementation of thread pools requires pool.terminate to be called otherwise the processes are kept around
  2. The pandas memory leak in the issue link previously. I added the monkey patch suggested in the issue which seems to do the trick
  3. I added some explicit garbage collection around file generation
    I've also made the commands calls in the task worker create a sub process calling the oasislmf executabe so it shouldnt use any memory anymore once complete, I'm having issues getting it running locally atm so this hasnt been tested fully yet but ill open a pr for it

@mpinkerton-oasis
Copy link
Author

@OmegaDroid could you add the link for the Pandas issue.

@OmegaDroid
Copy link
Collaborator

pandas-dev/pandas#2659

@mpinkerton-oasis mpinkerton-oasis moved this from To do to In progress in Jan 2020 Jan 20, 2020
@mpinkerton-oasis mpinkerton-oasis moved this from In progress to Complete in Jan 2020 Jan 21, 2020
@sambles
Copy link
Contributor

sambles commented Feb 4, 2020

1 & 2 done, adding an issue under OasisLmf for 3 and closing this issue

OasisLMF/OasisLMF#490

@sambles sambles closed this as completed Feb 4, 2020
@sambles sambles modified the milestones: 1.5.0, 1.4.2 Mar 23, 2020
@awsbuild awsbuild modified the milestones: 1.5.0, 1.15.5, 1.15.6 Mar 26, 2021
@awsbuild awsbuild modified the milestones: 1.15.6, 1.15.7 Apr 16, 2021
@sambles sambles removed this from the 1.15.7 milestone Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Jan 2020
  
Complete
Development

No branches or pull requests

4 participants