Skip to content

Fix sjA/sjFilter/sjChunks memory leaks#2676

Open
lkeegan wants to merge 1 commit intoalexdobin:masterfrom
lkeegan:fix_sj_memory_leaks
Open

Fix sjA/sjFilter/sjChunks memory leaks#2676
lkeegan wants to merge 1 commit intoalexdobin:masterfrom
lkeegan:fix_sj_memory_leaks

Conversation

@lkeegan
Copy link
Copy Markdown

@lkeegan lkeegan commented Mar 4, 2026

  • these were allocated and only used locally but not deleted

Only reserve and populate P.sjAll vectors when Solo SJ feature is requested

  • reduces memory use when Solo SJ feature is not requested

- these were allocated and only used locally but not deleted

Only reserve and populate `P.sjAll` vectors when Solo SJ feature is requested

- reduces memory use when Solo SJ feature is not requested
birdingman0626 added a commit to birdingman0626/STAR-Win that referenced this pull request Apr 13, 2026
Bug fixes from upstream STAR PRs:
- PR alexdobin#2163: Remove OOB write in sjdbInsertJunctions.cpp (SA.writePacked
  at index nSA is one past the end; memory corruption confirmed by Valgrind)
- PR alexdobin#2676: Fix memory leaks in outputSJ.cpp (sjA, sjFilter, sjChunks
  arrays allocated but never freed)
- PR alexdobin#535: Fix segfault in SA lookup shortcut in
  ReadAlign_maxMappableLength2strands.cpp (unreliable shortcut caused
  unsigned underflow and SIGSEGV on certain genomes)

Performance optimizations:
- PR alexdobin#791: PackedArray bitmask optimization (replace expensive double-shift
  with single AND in hot operator[]; ~1-2% improvement)
- PR alexdobin#791: Add FastResetVector.h (O(modified) reset instead of O(N) memset;
  available for winBin array optimization)
- PR alexdobin#773 (partial): Early rejection in stitchWindowAligns.cpp to skip
  unnecessary Transcript copies when alignment will obviously fail

HTSlib upgrade evaluated and deferred: current 1.3 has minimal security
surface (no CRAM, no network I/O, trusted input only).

Note: uniquely mapped count changes slightly due to PR alexdobin#535 fix — the
buggy shortcut was incorrectly skipping valid alignments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant