Garbage Collection on Appengine

834 views
Skip to first unread message

Sanjay Menakuru

unread,
Aug 8, 2011, 8:11:29 PM8/8/11
to google-ap...@googlegroups.com
Hey,

I was wondering how GC is done on Appengine. Is it when there's memory pressure, or on a schedule, or something else altogether?

The reason I ask, is something I noticed in the admin view while waiting for the blobstore issue to get sorted out. Right now my instance take up very little memory, usually 4.1 MB or so, when they're just started up. After I uploaded a 1.5 MB file, and the subsequent write to blobstore failed, the memory usage for the instance went up to 10.4 MB. All I'm doing really is using an io.MultiWriter to write to blobstore and take a sha1 sum at the same time. I dont allocate anything other than those writers. Obviously they're allocating behind the scenes, but I'm curious why the value doesn't subsequently go down.

I realize its not a huge issue at this scale, when its just me testing random things, but if the memory usage of the app grows proportional to the amount of data written to blobstore, then memory pressure could become a problem later. 

Also, its kinda weird that memory usage went up by 4 times the size of the file I uploaded. When I tried again with a 1.9 MB file, memory went up by 4.7 MB Any thoughts on whats causing this disproportionate memory usage?

Thanks in advance,

Sanjay

David Symonds

unread,
Aug 8, 2011, 8:34:05 PM8/8/11
to google-ap...@googlegroups.com
On Tue, Aug 9, 2011 at 10:11 AM, Sanjay Menakuru <balas...@gmail.com> wrote:

> I was wondering how GC is done on Appengine. Is it when there's memory
> pressure, or on a schedule, or something else altogether?

It's the same as in regular Go: typically when the allocation heap
size is twice the size of when the last GC run occurred.

> I realize its not a huge issue at this scale, when its just me testing
> random things, but if the memory usage of the app grows proportional to the
> amount of data written to blobstore, then memory pressure could become a
> problem later.

I wouldn't worry about it. App Engine will gracefully restart your
app's instances when it's consuming too much memory.


Dave.

Sanjay Menakuru

unread,
Aug 8, 2011, 11:09:10 PM8/8/11
to google-ap...@googlegroups.com

k, cool, thanks.
Reply all
Reply to author
Forward
0 new messages