File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,11 +140,13 @@ def check_memory_usage(self) -> None:
140140 usage_bytes , limit_bytes = memory_info
141141 usage_ratio = usage_bytes / limit_bytes
142142 usage_percent = int (usage_ratio * 100 )
143+ usage_gb = usage_bytes / (1024 ** 3 )
144+ limit_gb = limit_bytes / (1024 ** 3 )
143145
144146 if usage_ratio >= self ._critical_threshold and not self ._critical_raised :
145147 self ._critical_raised = True
146148 raise MemoryLimitExceeded (
147- internal_message = f"Memory usage is { usage_percent } % ({ usage_bytes } / { limit_bytes } bytes ). "
149+ internal_message = f"Memory usage is { usage_percent } % ({ usage_gb :.2f } / { limit_gb :.2f } GB ). "
148150 f"Critical threshold is { int (self ._critical_threshold * 100 )} %." ,
149151 message = f"Source exceeded memory limit ({ usage_percent } % used) and must shut down to avoid an out-of-memory crash." ,
150152 failure_type = FailureType .system_error ,
@@ -153,8 +155,8 @@ def check_memory_usage(self) -> None:
153155 if usage_ratio >= self ._warning_threshold and not self ._warning_emitted :
154156 self ._warning_emitted = True
155157 logger .warning (
156- "Source memory usage reached %d%% of container limit (%d / %d bytes )." ,
158+ "Source memory usage reached %d%% of container limit (%.2f / %.2f GB )." ,
157159 usage_percent ,
158- usage_bytes ,
159- limit_bytes ,
160+ usage_gb ,
161+ limit_gb ,
160162 )
You can’t perform that action at this time.
0 commit comments