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

Report memory use in time-passes #26691

Merged
merged 1 commit into from Jul 2, 2015

Conversation

Projects
None yet
5 participants
@nrc
Copy link
Member

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"))]

This comment has been minimized.

@alexcrichton

alexcrichton Jun 30, 2015

Member

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

Report memory use in time-passes
Reports the resident set size after each pass (linux-only).

@nrc nrc force-pushed the nrc:mem branch from 650c028 to 7713e14 Jul 1, 2015

@nrc

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 2, 2015

@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

This comment has been minimized.

Copy link
Contributor

bors commented Jul 2, 2015

⌛️ Testing commit 7713e14 with merge dd8fee0...

bors added a commit that referenced this pull request Jul 2, 2015

Auto merge of #26691 - nrc:mem, r=alexcrichton
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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

bors added a commit that referenced this pull request Jul 8, 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
You can’t perform that action at this time.