imbajin commented on code in PR #3325:
URL: https://github.com/apache/hugegraph/pull/3325#discussion_r4254015503


##########
hugegraph-server/hugegraph-dist/src/assembly/static/bin/util.sh:
##########
@@ -497,22 +497,67 @@ function cgroup_free_memory() {
         dir="${dir%/}"
     fi
     local limit usage inactive available smallest=""
+    local child child_min
     local cache_key=inactive_file
-    [[ "$version" != cgroup ]] || cache_key=total_inactive_file
+    local unlimited="" long_bits="" page_size=""
+    if [[ "$version" == cgroup ]]; then
+        cache_key=total_inactive_file
+        # v1 exposes PAGE_COUNTER_MAX * PAGE_SIZE instead of "max".
+        long_bits=$(getconf LONG_BIT 2>/dev/null) || true

Review Comment:
   Fixed. The v1 unlimited sentinel is now inferred from a recognized kernel 
machine name instead of the userspace LONG_BIT value. Unknown, masked, or 
failed uname results keep the numeric limit on the finite path; unreadable 
usage remains conservative. A real Bash control with LONG_BIT=32 and x86_64 
metadata reproduces the old 8 TiB finite-limit error and verifies the corrected 
256 MiB budget. This is a controlled metadata regression, not a claim of an 
actual 32-bit Linux deployment. Cgroup and launcher regressions, full 
compilation, and three independent reviews passed.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to