raco pollen start: memory usage slowly creeps up every refresh
Closedopened 6 years ago by kisaragi-hiu · 10 comments
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Upon each refresh, the memory usage goes up by about 1MB.
As I'm embedding live.js in my template.html to auto refresh the page, my system eventually ran out of memory.
I've tried to run the racket insta web app example (https://docs.racket-lang.org/continue/index.html?q=web%20applications) in DrRacket, which doesn't seem to increase its memory usage every refresh.
(I never see memory usage decrease with
raco pollen start, whereas drracket's memory usage does fluctuate)
Currently I put
raco pollen startin a while loop that kills raco after 10 minutes then repeats, which partly solves the issue.
I look at the memory usage in
What happens if you remove
live.js? (I’m not clear why you need this script anyhow, since Pollen’s project server will refresh changed files automatically)
Sorry for the delay, had to sleep & go to school.
If I remove
live.js, the memory usage would simply go up by about 1MB every time I refresh. All effect live.js has is just refreshing the page every second or so.
The files may be updated, but the browser doesn't know about it until refreshed or somehow notified, that's why I'm using the script.
Does the memory leak also show up in
top(say, in the
MEMcolumn)? That would be an easier way for me to assess what’s happening.
FWIW, when I watch
topon Mac OS while Pollen runs, on a refresh I see the memory usage jump up for a few seconds, but then decline (as GC kicks in)
It's the same in
top, the memory usage does not drop. I'm currently on Arch, and the only raco packages I have installed are
I've tried to create a new project:
mkdir /tmp/pollentest; cd /tmp/pollentest; raco pollen start, then navigating to the project dashboard,
localhost:8080, and monitoring the RES column in
top. It starts at 147.4m, and goes up by about 0.3m every refresh, without ever droping.
I'm on Pollen 1.2.1468.852 (Racket 6.10) right now, just updated.
I'm testing your files in Ubuntu 16.04 with Racket 6.10. I’m not able to duplicate the problem yet — in
gnome-system-monitor, the memory usage for
raco pollen startgoes up during a refresh (about 50-100 mb), but then goes down as garbage collection kicks in.
So I’m even more perplexed by this part of your bug report:
raco pollen startconstantly fluctuating (as I would expect).
Maybe somehow it's only happening in Arch-based distros? I've tried to install it in a Manjaro live session, and the leak is apparent there as well. This seems like a issue with either my system, Arch, or Racket actually...
Unfortunately I don’t have a way of testing this on Arch Linux. Though even then, I wouldn’t know why the problem is occurring or how to fix it. If memory isn’t getting released at all, that does seem like a deeper issue (Pollen doesn’t do any memory management).
The best I can do for now is leave the issue open in case you or someone else discovers the underlying cause.
I'm closing this as it's probably a problem in my own environment.