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

improves memory usage of add #1954

Closed
wants to merge 2 commits into from
Closed

improves memory usage of add #1954

wants to merge 2 commits into from

Conversation

whyrusleeping
Copy link
Member

Most of the memory leak in add was because the dag editor is given an in memory dagservice, and it adds all of the intermediate nodes to it. This makes it remove an intermediary node if its about to be changed and readded.

Memory pressure is reduced a good amount, but its not 'good' yet. The other changes I want to make need to be made on top dev0.4.0

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@jbenet jbenet added the status/in-progress In progress label Nov 9, 2015
@rht
Copy link
Contributor

rht commented Nov 9, 2015

Can this be captured with mean memory usage from command time -f '%K' ipfs add -r random-dir?

@rht
Copy link
Contributor

rht commented Nov 9, 2015

@whyrusleeping here is a quick script to check

TIME() {
    command time -f '%K' $*
}

perf() {
    mkdir -p foo
    random-files -q --depth=1 --files="$1" --filesize=1000 foo #1KB
    TIME ipfs add -r -q foo >hashname  # preferably --no-pin
    ipfs pin rm -r $(tail -n1 hashname)
    rm hashname
    rm -r foo
}

echo -n "" >outdata
for i in $(seq 10 50 5000)
do
    perf $i 2>>outdata
done

@whyrusleeping
Copy link
Member Author

@rht yeah, thats roughly what i was doing to test locally (minus it being a pretty shell script). The issue i noticed is that its not very consistent, so i'm hesitant to have strict tests around memory consumption, that said, We can probably make something like t0300-memory.sh and have things like this in it.

@jbenet jbenet removed the status/in-progress In progress label Nov 9, 2015
@whyrusleeping whyrusleeping reopened this Nov 9, 2015
@jbenet jbenet added the status/in-progress In progress label Nov 9, 2015
@jbenet
Copy link
Member

jbenet commented Nov 10, 2015

👍 to having mem tests.

  • rerunning tests as they halted.

@whyrusleeping
Copy link
Member Author

looks like i broke something... wheeeeee
image

@whyrusleeping whyrusleeping force-pushed the fix/add-mem branch 2 times, most recently from df57ec3 to 5ccad84 Compare November 10, 2015 19:31
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@whyrusleeping
Copy link
Member Author

@jbenet i can add a script that checks memory consumption here, but making it into a test is difficult, as every different os and computer will report different numbers. My linux desktop with 32GB ram running a given ipfs test will use more memory than my laptop with 8GB ram just due to the way memory is allocated, not to mention differences across osx, windows, linux and the various architectures of each.

@whyrusleeping whyrusleeping mentioned this pull request Nov 13, 2015
@whyrusleeping
Copy link
Member Author

closing in favor of #1965

@jbenet jbenet removed the status/in-progress In progress label Nov 13, 2015
@Kubuxu Kubuxu deleted the fix/add-mem branch February 27, 2017 20:38
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.

3 participants