Skip to content

Report memory use in time-passes #26691

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

Merged
merged 1 commit into from
Jul 2, 2015
Merged

Report memory use in time-passes #26691

merged 1 commit into from
Jul 2, 2015

Conversation

nrc
Copy link
Member

@nrc nrc commented Jun 30, 2015

Reports the resident set size after each pass (linux-only).

r? @huonw or @alexcrichton

Some(npages * ::std::env::page_size())
}

#[cfg(not(target_os="linux"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is just using normal apis, could this do if cfg! instead of #[cfg]? (helps porting and dealing with unused imports).

Reports the resident set size after each pass (linux-only).
@nrc
Copy link
Member Author

nrc commented Jul 1, 2015

Updated; r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned huonw Jul 1, 2015
@retep998
Copy link
Member

retep998 commented Jul 2, 2015

Why not Windows as well?

let mut pmc: PROCESS_MEMORY_COUNTERS = mem::zeroed();
pmc.cb = mem::size_of_val(pmc);
assert!(GetProcessMemoryInfo(GetCurrentProcess(), &mut pmc, pmc.cb) != 0);
return pmc.WorkingSetSize;

@nrc
Copy link
Member Author

nrc commented Jul 2, 2015

@retep998 a PR would be very welcome! (I can't test it myself, so not keen to try).

@alexcrichton
Copy link
Member

@bors: r+ 7713e14

I agree that it's not super critical that we have a windows implementation right out of the gate, but feel free to PR it!

@bors
Copy link
Collaborator

bors commented Jul 2, 2015

⌛ Testing commit 7713e14 with merge dd8fee0...

bors added a commit that referenced this pull request Jul 2, 2015
Reports the resident set size after each pass (linux-only).

r? @huonw or @alexcrichton
@bors bors merged commit 7713e14 into rust-lang:master Jul 2, 2015
bors added a commit that referenced this pull request Jul 9, 2015
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

Successfully merging this pull request may close these issues.

5 participants