Skip to content

Fix memory reporting (RSS vs vsize confusion) and oracle cache size overflow#804

Merged
msoos merged 3 commits intoworking-on-synthfrom
copilot/sub-pr-801
Mar 11, 2026
Merged

Fix memory reporting (RSS vs vsize confusion) and oracle cache size overflow#804
msoos merged 3 commits intoworking-on-synthfrom
copilot/sub-pr-801

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

The time_mem.h refactoring split memUsedTotal(double&) into mem_used(double&) (returns RSS) and memUsedTotal() (returns vsize), but several call sites were updated incorrectly.

Memory reporting bugs

  • dump_memory_stats_to_sql(): mem_used() resolves to Solver::mem_used() (internal accounting) instead of system RSS — SQL "rss" metric was completely wrong
  • print_mem_stats(): memUsedTotal() returns vsize, not RSS — all "Accounted for mem (rss)" percentages used wrong denominator
  • print_norm_stats(): Same vsize/RSS confusion, plus max_mem_usage (VmHWM) was never populated, making the else branch dead code
  • occsimplifier.cpp: memUsedTotal() used where RSS was intended

Added rss_mem_used() to time_mem.h (all platforms) to provide RSS without a dummy output parameter, avoiding the Solver::mem_used() name collision.

Oracle cache size overflow

constexpr auto max_cache_size = 40000U;  // uint32_t
const uint32_t stride = vars+1;
if (sol_cache.size() > max_cache_size * stride) // overflows when vars > ~107K

Changed max_cache_size to size_t so the multiplication promotes correctly.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix issues with synth implementation Fix memory reporting (RSS vs vsize confusion) and oracle cache size overflow Mar 11, 2026
@msoos msoos marked this pull request as ready for review March 11, 2026 22:09
@msoos msoos merged commit db78279 into working-on-synth Mar 11, 2026
10 checks passed
@msoos msoos deleted the copilot/sub-pr-801 branch March 11, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants