Skip to content

Modeling - Memory consumption in BOPAlgo_PaveFiller_6.cxx#864

Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi:bop_inc_allocator_inner_loop
Nov 30, 2025
Merged

Modeling - Memory consumption in BOPAlgo_PaveFiller_6.cxx#864
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom
dpasukhi:bop_inc_allocator_inner_loop

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

Fixed loop allocator to prevent memory leaks.

Fixed loop allocator to prevent memory leaks.
@dpasukhi dpasukhi added this to the Release 7.9.3 milestone Nov 29, 2025
@dpasukhi dpasukhi requested a review from Copilot November 29, 2025 20:57
@dpasukhi dpasukhi self-assigned this Nov 29, 2025
@dpasukhi dpasukhi added the 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... label Nov 29, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses memory consumption issues in BOPAlgo_PaveFiller_6.cxx by optimizing memory allocation strategy in the MakeBlocks method. The fix prevents memory accumulation when processing multiple face-face intersection pairs by introducing a temporary allocator that is reset between iterations.

Key Changes:

  • Introduced a separate temporary allocator (aTmpAllocator) for per-iteration collections
  • Reorganized collection declarations to distinguish between temporary (per-iteration) and persistent (cross-iteration) data structures
  • Added allocator reset logic at the start of each iteration to reclaim memory

// Temporary allocator for per-iteration collections that are cleared each iteration.
// Using separate allocator allows to reclaim memory via Reset(false) at the start
// of each iteration, preventing memory accumulation in the main loop.
Handle(NCollection_IncAllocator) aTmpAllocator = new NCollection_IncAllocator;
Copy link

Copilot AI Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent spacing: there are multiple spaces between the type and variable name. Use single space for consistency with line 673.

Suggested change
Handle(NCollection_IncAllocator) aTmpAllocator = new NCollection_IncAllocator;
Handle(NCollection_IncAllocator) aTmpAllocator = new NCollection_IncAllocator;

Copilot uses AI. Check for mistakes.
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
Comment thread src/ModelingAlgorithms/TKBO/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
@dpasukhi dpasukhi merged commit a26ad4b into Open-Cascade-SAS:IR Nov 30, 2025
23 checks passed
@dpasukhi dpasukhi deleted the bop_inc_allocator_inner_loop branch November 30, 2025 10:29
@github-project-automation github-project-automation bot moved this from Todo to Done in Maintenance Nov 30, 2025
@dpasukhi dpasukhi linked an issue Nov 30, 2025 that may be closed by this pull request
dpasukhi added a commit to dpasukhi/OCCT that referenced this pull request Dec 5, 2025
…de-SAS#864)

- Introduced a separate temporary allocator (`aTmpAllocator`) for per-iteration collections
- Reorganized collection declarations to distinguish between temporary (per-iteration) and persistent (cross-iteration) data structures
- Added allocator reset logic at the start of each iteration to reclaim memory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc...

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Large memory consumption in BOPAlgo_PaveFiller

2 participants