[18.0][IMP] MemoryError failures for big exports #1010
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 158 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.303
Real PR Conversation Timeline
1 comments
"Review active on #1010"
general
weight: 0.35
florentx
Based on #849, the last commit to review for this PR.
Large asynchronous export fails with a
MemoryError, what's implemented:export_databy batches ofPREFETCH_MAXand cache invalidation between batches (as odoo/odoo#257333 does for the web export);Benchmarks
Fake partners (8 fields including a many2many):
| # Records | Format | RAM before | RAM after | Time before | Time after |
|---:|---|---:|---:|---:|---:|
| 30,000 | csv | 152 MiB | 61 MiB | 9.4 s | 9.3 s |
| 30,000 | xlsx | 281 MiB | 37 MiB | 20.7 s | 22.2 s |
| 200,000 | csv | 1,073 MiB | 390 MiB | 61.5 s | 57.3 s |
| 200,000 | xlsx | 1,953 MiB | 229 MiB | 141.8 s | 158.5 s |
Real case
33,557 invoices exported in xlsx, peak memory of the process (Odoo default limits: 2,048 MiB soft, 2,560 MiB hard):
| Models | RAM before | RAM after | Time before | Time after |
|---|---:|---:|---:|---:|
| Invoices and lines with 17 fields | 732 MiB | 353 MiB | 47.0 s | 48.7 s |
| Invoices, lines and reconciliations with 30 fields | 2,190 MiB | 429 MiB | 125.5 s | 103.0 s |
The xlsx export now uses temporary files (about twice the uncompressed sheet, removed once exported).