I have some code that goes as follows: (defop foo req
(let x <something that allocates a bunch of memory>
...))
Each time page foo is requested, a new x should be created. That works. The problem is, after the user leaves page foo, x's memory isn't getting freed. [1] Any idea how to make sure that happens?I spent the evening sniffing for clues in srv.arc. Though my understanding of srv.arc is still incomplete, I've gotten far enough to realize it knows how to kill its idle threads (that is, unless I misunderstand how handle-request-1 works). Suggestions would be appreciated. --- [1] The way I diagnosed this was to test the app with top open in a terminal. Each time I opened a new browser tab to the URL, top showed the % memory usage of my mzscheme process to increase. It did not show a significant decrease after closing the tabs, even after waiting several minutes. I tested this repeatedly on tens of tabs. |