Modeling - Memory consumption in BOPAlgo_PaveFiller_6.cxx#864
Merged
dpasukhi merged 1 commit intoOpen-Cascade-SAS:IRfrom Nov 30, 2025
Merged
Conversation
Fixed loop allocator to prevent memory leaks.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed loop allocator to prevent memory leaks.