-
Notifications
You must be signed in to change notification settings - Fork 152
Description
I was experimenting with xilem (see #14 (comment)) and noticed that the memory and CPU consumption of xilem was exceptionnally high:
Now, I'm totally aware that xilem is in the experimental state, but surely it shouldn't ever consume that much, right?
I didn't properly investigate the CPU consumption yet, but as for the memory consumption, I used heaptrack to do some heap profiling. It's the first time I do something like this so I was quite amazed at how quickly I arrived to a conclusion:
There are 2 huge culprits of memory consumption, one taking ~874 MB and the other taking ~894 MB. It turns out, both come from parley::FontCache::new()
.
I looked at the code inside parley, and it seems that it's loading every single font from my system into memory, which is less than ideal...
I'm of course going to forward this issue to parley, but in the mean time, is there any simple workaround for xilem so that it doesn't take 2 gigs of ram just for experimentation?
Here's the .zst
file that you can open with heaptrack_gui
(I think it only works on Linux).
heaptrack.xilem.44968.zip