clone a Repo, The memory has increased from 1m to 20m and will not be released
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 450
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Description
I use this code to clone repo, The memory has increased from 1m to >20m and more。And will not be released
fn clone(){
let mut callbacks = RemoteCallbacks::new();
callbacks.credentials(|_url, username_from_url, _allowed_types| {
Cred::userpass_plaintext("abc","abcd)
});
// Prepare fetch options.
let mut fo = git2::FetchOptions::new();
fo.remote_callbacks(callbacks);
// Prepare builder.
let mut builder = git2::build::RepoBuilder::new();
builder.fetch_options(fo);
let r= builder.clone(
"http://xxxx.git",
Path::new("/code-analyse/"),
);
match r{
Ok(repo) => {println!("ok") }
Err(e) => {println!("{}",e)}
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported growth in the shown clone function using git2::build::RepoBuilder::clone and monitor memory before and after the operation. Trace the clone and fetch path used by RepoBuilder, then verify that repeated clones release memory and add or run a focused regression test if the repository provides one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100