Kontinuation commented on code in PR #687:
URL: https://github.com/apache/sedona-db/pull/687#discussion_r2885335092


##########
rust/sedona/src/context_builder.rs:
##########
@@ -33,26 +33,53 @@ use crate::{
     size_parser,
 };
 
+/// The fraction of total physical memory to use as the default memory limit.
+const DEFAULT_MEMORY_FRACTION: f64 = 0.75;
+
+/// Compute the default memory limit as 75% of total physical memory.
+fn default_memory_limit() -> usize {
+    let mut sys = sysinfo::System::new();
+    sys.refresh_memory();
+    let total = sys.total_memory() as f64;
+    (total * DEFAULT_MEMORY_FRACTION) as usize

Review Comment:
   Copilot is wrong. The sysinfo 0.38 docs explicitly state: total_memory() → 
"Returns the RAM size in bytes." The KiB behavior was in ancient versions 
(pre-0.23). The example in sysinfo's own repo divides by 1_000 (not 1_024) to 
get KB, confirming bytes. Our code is correct as-is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to