raco pollen start: memory usage slowly creeps up every refresh
#149
Closed
opened 7 years ago by kisaragi-hiu
·
10 comments
Loading…
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 start
in a while loop that kills raco after 10 minutes then repeats, which partly solves the issue.Interesting.
I look at the memory usage in
gnome-system-monitor
.Also, my
pollen.rkt
:And my
template.html
: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 theMEM
column)? That would be an easier way for me to assess what’s happening.FWIW, when I watch
top
on 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 aremain-distribution
,racket-lib
, andpollen
.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 intop
. 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 forraco pollen start
goes 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:
I see
raco pollen start
constantly 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.