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

Ephemeral Container Memory Leak (re: tmpfs) #24

Closed
zpatten opened this issue Jun 5, 2013 · 5 comments
Closed

Ephemeral Container Memory Leak (re: tmpfs) #24

zpatten opened this issue Jun 5, 2013 · 5 comments

Comments

@zpatten
Copy link

zpatten commented Jun 5, 2013

Please excuse this if the issue is already known, but I was unable to find others who had encountered this issue.

When using ephemeral containers, under raring (i.e. LXC 0.9.0) with standard filesystem based storage, the post-stop script does not umount the tmpfs or unionfs; it simply runs rm -Rf against the containers directory.

I have been able to reproduce the memory leak by repeatedly starting an ephemeral container, run a set of commands against said container (apt-get installs, chef runs, etc), stopping said container; then rinse and repeat. After many cycles (in my case around 10 or more) the host running the ephemeral containers will run out of memory and oom killer swings into action in full force.

When I use the ephemeral containers with the --keep-data flag, memory usage behaves as expected and the issue disappears.

At this point I do not have any direct evidence to show; but I can say for certain that taking tmpfs out of the picture fixed this issue. This has led me to believe that in the post-stop script LXC should be calling umount against the unionfs and tmpfs mount points the pre-mount script created.

My theory is that since it is not calling umount the memory used by ephemeral tmpfs mounts seems to stay allocated and becomes orphaned.

I would happily submit a patch for this; but I do not currently meet your contribution guidelines, so I wanted to go ahead and bring this to your attention.

@hallyn
Copy link
Member

hallyn commented Jun 11, 2013

Thanks, I believe this is due to the following bug:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1098378

@zpatten
Copy link
Author

zpatten commented Jun 29, 2013

@hallyn Thanks, that seems to be the issue, or at the very least is related to. Thanks again!

I'll leave it to you to close this out or leave it open if you want to keep this visible for others to see.

@hallyn
Copy link
Member

hallyn commented Jul 25, 2013

I would happily submit a patch for this; but I do not currently meet your contribution guidelines, so I wanted to go ahead and bring this to your attention.

We have contribution guidelines?

AFAIK so long as you send the patch with a valid Signed-off-by we can
apply it.

@zpatten
Copy link
Author

zpatten commented Jul 27, 2013

https://github.com/lxc/lxc/blob/staging/CONTRIBUTING

Seemed like more was required; but I hastily read that originally.

From what the bug you linked above seemed to indicate, the issue was not with LXC; so it did not seem there was a fix for me to submit in retrospect. When I get some free time (about to move from apartment to house next week; so prolly not until after that), I take a close look at this issue again and re-evaluate.

@stgraber
Copy link
Member

stgraber commented Aug 7, 2013

Closing the issue as my understanding is that this was caused by a kernel bug which has now been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants