fix(velocity): Memory and sync issues
Nobody has claimed this yet.
- #34050 by @wezell — closed without merging
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Problem Statement
There are a number of improvements we can make to velocity to improve its memory footprint. For starters, we do not even stream our responses, we turn them into String buffers and then send them.
Additionally, there are a number of places where we can use ThreadLocals to store buffers and arrays and not have to reallocate them on every page hit.
Also would like to get rid of the synchronized block in the DotResourceLoader that we have seen act up.
- Retain full backward compatibility
- Ensure all tests pass
- Benchmark the code before and after
dotCMS Version
latest
Conversation link
https://dotcms.slack.com/archives/C04FRV45YR5/p1765222245235399
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the velocity response handling and DotResourceLoader synchronization points mentioned in the issue. Establish baseline memory and synchronization benchmarks before changing anything, then run the full test suite and compare results. Done means backward compatibility is retained, tests pass, and the benchmark shows the intended memory and sync improvements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100