On x86_64-unknown-linux-gnu memory is not freed when a loaded font is dropped, minimal repro.
use fontdue::{Font, FontSettings};
fn main() {
// Your font below
let font = "../font.ttf";
let font_bytes = std::fs::read(font).unwrap();
let font = Font::from_bytes(font_bytes.as_slice(), FontSettings::default()).unwrap();
drop(font);
drop(font_bytes);
loop {
}
}
Running smem on that gives about 18M;
pmap shows
Where the 17+M is the font footprint in memory.
use fontdue::{Font, FontSettings};
fn main() {
// Your font below
let font = "../font.ttf";
let font_bytes = std::fs::read(font).unwrap();
//let font = Font::from_bytes(font_bytes.as_slice(), FontSettings::default()).unwrap();
//drop(font);
drop(font_bytes);
loop {
}
}
Running smem on that gives about 532K.
Dropping or not dropping the font has no impact on memory usage.
I might be doing something dumb and not realizing it, or memory is not released when the Font struct is dropped for some reason.
On x86_64-unknown-linux-gnu memory is not freed when a loaded font is dropped, minimal repro.
Running smem on that gives about 18M; pmap shows
Where the 17+M is the font footprint in memory.
Running smem on that gives about 532K. Dropping or not dropping the font has no impact on memory usage.
I might be doing something dumb and not realizing it, or memory is not released when the Font struct is dropped for some reason.