Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions alacritty_terminal/src/term/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,16 @@ impl<T: EventListener> Handler for Term<T> {

self.event_proxy.send_event(Event::CursorBlinkingChange);
self.mark_fully_damaged();

// glibc tends to not release the memory until everything associated with the `Term` is
// removed due to fragmentation. Though, even there's a fragmentation we could still
// release the _physical_ memory back fragmenting the address space.
//
// The fragmentation will fixup itself once the `Term` is fully dropped.
#[cfg(all(target_env = "gnu", target_os = "linux"))]
unsafe {
libc::malloc_trim(0);
}
}

#[inline]
Expand Down