bt
CDCloudflare Developers
•Created by bt on 7/4/2024 in #workers-help
Debugging Workers Memory Usage
Hi all,
I'm working on a fun project in which I'm using Workers to accept a POST request of some TSX code, and then it will use
esbuild-wasm
to build and bundle it, then respond with an HTML and the bundle JS inline. I have it working already with minimal code (ie. POSTing only a couple of lines of code) but when I try to give it say, a page to render, it fails with memory limit exceeding.
I understand this might be a bit overkill for 128MB of memory in Workers, but ideally, I don't want to manage any infrastructure, so I would hope I can get this working on Workers. I am already using paid Workers, so hence why I am able to deploy (since esbuild-wasm
alone is huge).
I want to see if I can debug the memory usage of the function. I tried to follow the guide on the CF website, but it's not very useful. I also looked at a couple of posts on Discord, and it's equally not useful either. Does anyone have any idea how I should approach this or could shed some light to how I could reduce memory usage?
Thanks!1 replies