lvivski / start

Sinatra inspired web development framework for Dart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Memory leak?

freewind opened this issue · comments

I cloned start, and run the example "start / example / app.dart".

I can see it uses 24M memory from activity monitor (from ios)

Then I visit http://localhost:3000, where I can see the "Start is awesome"

I refreshed the browser quickly, and found the memory it used growing fast, soon became "51M+"

Then I run "purge" from command line, it became "50M"

I'm worried if start/dart has memory leak? Or do I misunderstand something?

What do you mean, when you mention iOS? You open a page on it, os start a new server on it? Nevertheless I'll investigate memory leaks

I mention iOS because I checked the memory from "activity monitor"(which is a monitor software on iOS).

I cloned the source code on my macbook, and run the "example/app.dart", so there is a server. Then I use ab -c 30 -n 10000 http://localhost:3000/, the server's memory usage is growing, until it gets "78M" in the end ( won't larger than that), and it will never fall back, even if I use "purge" command to release unused memory.

I forgot to mention, when I use ab to test, sometimes the server refused the connection, and test often failes (can't complete all requests)

I think you mean OS X, when you say iOS ('cause iOS is for iPhone and iPad). So in case you do really use OS X you have to know, that the ab bundled with OS X is buggy, so you can't rely on its results. And for Activity Monitor, the server needs more memory when you have more connections (and concurrent connections) and it doesn't release the memory after, it's just how memory management in OS X and dart works, it doesn't release the memory, until it's needed for another process

So if memory doesn't go up after some amount, it means that the GC works, and you don't have to worry about it

Thank you for your answer, many thanks !!

I thought mac OS is called iOS, thanks for correct me :)