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

How to shutdown daemon completely in code or clear the memory of it. #2991

Open
zyzhangyang opened this issue Jul 26, 2016 · 7 comments
Open
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/analysis Needs further analysis before proceeding

Comments

@zyzhangyang
Copy link

Version/Platform/Processor information (from ipfs version --all):ipfs version --all

Type (bug, feature, meta, test failure, question):feature
Area (api, commands, daemon, fuse, etc):daemon
Priority (from P0: functioning, to P4: operations on fire):P3

Description:
I have integrated ipfs to mobile client by modifying the main entry to api mode.Now I have to shutdown damon,because ios will suspend the app after it enters background several minutes and ipfs will not work on entering foreground. I get the IpfsNode on daemonfunc,call IpfsNode.close() to close daemon,daemon will return,and I can retart daemon.But the memory will increase after retart daemon everytime. So I want to find methods to shutdown daemon completely,and can reduce the memory of ipfs.

@whyrusleeping
Copy link
Member

we havent put much effort yet into mobile, soft restarts like this are going to be very important, as well as a 'background mode' option.

What does memory usage look like for you? 100MB? 200MB?

@zyzhangyang
Copy link
Author

@whyrusleeping First I start daemon,the memory usage is about 60MB,after restart daemon every time,it will increase about 40MB,and it will reach 200MB very easy. So I want to know how to modify source code to close daemo completely and release memory?

@whyrusleeping
Copy link
Member

@zyzhangyang how are you interfacing with the daemon? as a subprocess, or are you embedding go code?

@zyzhangyang
Copy link
Author

@whyrusleeping I modify the main.go in cmd/ipfs to a lib,then compile the ipfs to a framework by using go bind,and then I start a thread to start daemon in ios. Call other ipfs interface in other thread.

@whyrusleeping
Copy link
Member

whyrusleeping commented Jul 27, 2016

Can you get me any of the profiling information discussed in the debug guide ?

@zyzhangyang
Copy link
Author

@whyrusleeping
The attach file is the debug info,please see would it help?
ios_ipfs_debug_info.zip

@em-ly em-ly added the kind/enhancement A net-new feature or improvement to an existing feature label Aug 25, 2016
@whyrusleeping whyrusleeping added the need/analysis Needs further analysis before proceeding label Sep 14, 2016
@xuruijing
Copy link

Can you share your code for ios-ipfs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature need/analysis Needs further analysis before proceeding
Projects
None yet
Development

No branches or pull requests

4 participants