-
Notifications
You must be signed in to change notification settings - Fork 235
[cuebot/cuegui/pycue/rqd] Store PSS and MaxPSS #2112
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
base: master
Are you sure you want to change the base?
[cuebot/cuegui/pycue/rqd] Store PSS and MaxPSS #2112
Conversation
c303484 to
31e5cc4
Compare
ramonfigueiredo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor suggestions
| ADD int_max_pss INT DEFAULT 0; | ||
|
|
||
| -- Add PSS fields to layer_resource table | ||
| ALTER TABLE layer_resource | ||
| ADD int_max_pss INT DEFAULT 0; | ||
|
|
||
| -- Add PSS fields to proc table | ||
| ALTER TABLE proc | ||
| ADD int_pss_max_used BIGINT DEFAULT 0, | ||
| ADD int_pss_used BIGINT DEFAULT 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data Type Inconsistency
job_mem.int_max_pssandlayer_mem.int_max_pssuse INT (4 bytes, max ~2TB in KB)frame.int_pss_max_usedandproc.int_pss_max_useduse BIGINT (8 bytes)
For consistency and future-proofing, consider using BIGINT for all PSS fields. While 2TB is unlikely to be reached, using the same type across all tables improves maintainability.
| max_used_gpu_memory: (stats.max_used_gpu_memory / KIB) as i64, | ||
| used_gpu_memory: (stats.used_gpu_memory / KIB) as i64, | ||
| children, | ||
| ..Default::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing used_swap_memory in RunningFrameInfo
The RunningFrameInfo in clone_into_running_frame_info() uses ..Default::default() which means used_swap_memory (field 19) is not being set. This appears to be pre-existing, but worth noting if swap tracking is important.
| int64 max_gpu_memory = 11; | ||
| int64 used_gpu_memory = 12; | ||
| FrameStateDisplayOverride frame_state_display_override = 13; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpdatedFrame Missing PSS Fields
- The
UpdatedFramemessage (used for incremental frame updates) doesn't include PSS fields (max_pss,used_pss). This means theFrameMonitorTreewon't show updated PSS values during incremental updates - only on full refreshes.
| byte[] children = new byte[100]; | ||
|
|
||
| procDao.updateProcMemoryUsage(frame, 100, 100, 1000, 1000, 0, 0, 0, children); | ||
| procDao.updateProcMemoryUsage(frame, 100, 100, 100, 100, 1000, 1000, 0, 0, 0, children); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage concern:
- The test change only adds one line for PSS verification. Consider adding more comprehensive tests for:
- PSS aggregation logic in
updateJobMemoryUsageandupdateLayerMemoryUsage - Edge cases (PSS > RSS, PSS = 0)
- PSS aggregation logic in
| /// Amount of memory used by all processes in this session | ||
| memory: u64, | ||
| rss: u64, | ||
| /// Amount of memory used by all processes in this session | ||
| pss: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation comment inconsistency.
/// Amount of memory used by all processes in this session
rss: u64,
/// Amount of memory used by all processes in this session
pss: u64,The pss comment is identical to rss. Should differentiate (as done in linux.rs:116-118):
/// Amount of memory used by all processes in this session calculated by rss
rss: u64,
/// Amount of memory used by all processes in this session calculated by pss
pss: u64,
Overview
Update modules to properly store PSS (Proportional Set Size) alongside RSS (Resident Set Size) for measuring process memory usage on Linux systems.
Key Differences:
/proc/[pid]/smaps_rollup(Linux kernel 4.14+) provides pre-summed PSS valuesCurrent State:
Rqd contains a config property to collect memory as either RSS or PSS. Information is saved on Cuebot and displayed as Rss.
Proposed Solution:
Rqd collects and reports both RSS and PSS. Cuebot stores both in the database. pycue and cuegui display both.
Tasks: