Open wilg opened 5 years ago
That control in particular only works if background threads were compiled into jemalloc. I know that they're not supported on macOS, for example.
Ah, shoot, that must be it, I'm using macOS for development. Any advice for the best way to detect if its supported? I'd like to have my program work on macOS but have the background thread enabled on Linux (which is the production environment).
Also, are there any alternatives to this background thread that you can think of? I've got a program that typically uses very little memory but occasionally has large spikes for a particular task. I'd like to return that memory to the OS (which Rust doesn't seem to do by default) since it is running in a web server environment and the platform will kill the process if it stays above its memory budget for too long.
I just try to enable background threads and log a warning if that fails personally.
Basic usage seems to crash my program. I'm only a few months in to Rust, so perhaps I'm doing something incredibly wrong here, but this has me baffled.
The same thing happens if I try to get or set the number of background threads.
Here's the error:
Also, do you happen to know if jemalloc's background threads are enabled by default or not?