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

Make the new IO code use less memory. #58

Closed
jlouis opened this issue Dec 7, 2010 · 4 comments
Closed

Make the new IO code use less memory. #58

jlouis opened this issue Dec 7, 2010 · 4 comments

Comments

@jlouis
Copy link
Owner

jlouis commented Dec 7, 2010

The new IO code can at time utilize quite large amounts of memory. This is due to the fact that the process is so lightweight it never gets garbage collected. Thus, it is never seen that the binary() data it has is dead and be collected.

It can be verified by executing the following from a shell:

 [garbage_collect(P) || P <- processes()].

This means we should probably build in some form of garbage collection into the system on a timer, so when a function has not been utilized for a short while, it will try to GC itself. Also, we should probably hack the fullsweep_after spawn_opt.

@ghost
Copy link

ghost commented Dec 7, 2010

We could set the process to always perform a full sweep, in spawn_opt that would be:
{fullsweep_after, 0}

@jlouis
Copy link
Owner Author

jlouis commented Dec 7, 2010

That, and also have a small timeout of 1-5 seconds and then ask for a GC after this.

@ghost
Copy link

ghost commented Dec 7, 2010

###As it is now on my fs-code branch

  • File servers are always spawned with {fullsweep_after, 0}
  • A file server will always garbage collect after 5 seconds of inactivity.
  • An inactive file server which has performed a GC will not perform a GC again after 5 seconds of inactivity.

@jlouis
Copy link
Owner Author

jlouis commented Dec 8, 2010

Rawr, merged to master.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant