Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print GC stats when server catches Out_of_memory #1071

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
7 changes: 6 additions & 1 deletion src/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ let catch_all f =
(* Util.msg "Done catch_all...\n"; *)
with Prefs.IllegalValue str -> raise (Util.Fatal str)
with e ->
Util.msg "Unison server failed: %s\n" (Uicommon.exn2string e); exit 1;;
Util.msg "Unison server failed: %s\n" (Uicommon.exn2string e);
(* A final desperate attempt to print out some debug information.
If we are really-really out of memory then this may fail but
then it's unlikely we reach this point anyway. *)
if e = Out_of_memory then Gc.print_stat stderr;
exit 1

let gui_safe_printf fmt =
Printf.ksprintf (fun s ->
Expand Down
Loading