Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve child handling#140

Open
rokroskar wants to merge 6 commits intopythonprofilers:masterfrom
rokroskar:improve_child_handling
Open

Improve child handling#140
rokroskar wants to merge 6 commits intopythonprofilers:masterfrom
rokroskar:improve_child_handling

Conversation

@rokroskar
Copy link

This pull request is an extension to#118 and#134 and tries to improve the ability to analyze child process memory consumption.

Changes/additions:

  • track child processes bypid instead of sequentially -- this is to ensure that we can properly track children of processes where the parent might continuously spawn many short-lived children
  • add aconvert_mem_usage_to_df function which produces apandas.DataFrame from a list returned bymemory_usage for easier plotting and slicing
  • add the ability ofmprof to monitor an existing process by providing a pid

Side-effects:

  • move theread_mprofile_file function tomemory_profiler so that it can be used programatically
  • add aread_mprofile_file_multiprocess function that reads a mprofile file and returns a list of timings identical to what you expect frommemory_usage
  • fixbug inmemory_usage #139
  • fix bug inplot_file where plotting would fail when number of children > 6
  • add atimeout flag tomprof

@fabianp
Copy link
Collaborator

Thanks for the pull request!. This looks good, but give me a couple of days to look into it as I'm currently travelling

@fabianp
Copy link
Collaborator

Why is pandas needed? Does this change the quality of the plots? I would like to maintain dependencies to the strict minimum ...

@fabianp
Copy link
Collaborator

(numpy is fine since its required by matplotlib anyway)

@rokroskar
Copy link
Author

Right, pandas is not strictly needed and I also hesitate making another dependency. IMO the usability of the results is improved by putting them into a DataFrame. The user can then select only the PIDs they want, they can get averages, etc. It's a simple way to allow for a bit more customization.

On the other hand, it's not really a dependency, since the only function that needs pandas isconvert_mem_usage_to_df and one could add a try/except there and alert the user that pandas is needed for that function. Another option would be to just return the numpy matrix that I generate along with the mapping of x and y coordinates to times and pids, but that's not as user-friendly.

@rokroskar
Copy link
Author

oh oops, I guess I already added the try/except in my last commit...

@fabianp
Copy link
Collaborator

fabianp commentedApr 12, 2017 via email

I've seen the try block. However I would like to be able to plot withoutpandas.Also, add your name and contribution to the Readme if you want.Cheers
On Apr 12, 2017 9:59 AM, "Rok Roškar" ***@***.***> wrote: oh oops, I guess I already added the try/except in my last commit... — You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/fabianp/memory_profiler/pull/140#issuecomment-293503093>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAQ8h3hgdhSAr4RuOoCEmW8r2xCPIfARks5rvIRtgaJpZM4M1qBd> .
cmin764 reacted with thumbs up emoji

@eamars
Copy link

eamars commentedFeb 14, 2019
edited
Loading

Hello Guys
Thanks for your contribution! I find categorizing child process is extremely helpful. However the last change were committed in 2017. Is this issue going to be closed or should have been merged? Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

bug inmemory_usage

3 participants

@rokroskar@fabianp@eamars

[8]ページ先頭

©2009-2026 Movatter.jp