v0.27.3: Use real system memory everywhere, add monitoring memory bar

Deploy page, pre-start check, and deploy validation now use actual
/proc/meminfo usage instead of declared mem_request sums. New
GetMemoryMB() helper for lightweight real-time memory reads. Monitoring
page gains a stacked memory distribution bar showing per-container
usage, OS overhead, and free memory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 10:06:03 +01:00
parent c33247abc1
commit ad4c005e01
10 changed files with 151 additions and 36 deletions
+3 -4
View File
@@ -334,15 +334,14 @@ func (r *Router) actionStack(w http.ResponseWriter, action, name string) {
if action == "start" {
stackMemMB := r.stackMgr.StackMemoryMB(name)
if stackMemMB > 0 {
if totalMB, memErr := system.GetTotalMemoryMB(); memErr == nil {
if totalMB, usedMB, memErr := system.GetMemoryMB(); memErr == nil {
reservedMB := r.cfg.System.ReservedMemoryMB
usableMB := totalMB - reservedMB
committedReqMB, _ := r.stackMgr.CommittedMemory()
afterMB := committedReqMB + stackMemMB
afterMB := usedMB + stackMemMB
if afterMB > usableMB {
writeJSON(w, http.StatusConflict, apiResponse{
OK: false,
Error: fmt.Sprintf("Nincs elég memória az indításhoz. Szükséges: %d MB, elérhető: %d MB (foglalt: %d MB / használható: %d MB)", stackMemMB, usableMB-committedReqMB, committedReqMB, usableMB),
Error: fmt.Sprintf("Nincs elég memória az indításhoz. Szükséges: %d MB, elérhető: %d MB (használt: %d MB / használható: %d MB)", stackMemMB, usableMB-usedMB, usedMB, usableMB),
})
return
}