Commit 3d62e03
authored
CNDB-15990: Avoid varargs allocations in atomicMoveWithFallback (#2124)
### What is the issue
riptano/cndb#15990
### What does this PR fix and why was it fixed
- What: Eliminates unnecessary array allocations in
PathUtils.atomicMoveWithFallback() by pre-allocating CopyOption[] arrays
as static constants.
- Why: JFR profiling showed this method was a memory allocation hotspot
during RemoteFileCache preloading. Each call to Files.move() with
varargs parameters created new arrays, causing excessive GC pressure.1 parent 97eaa52 commit 3d62e03
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
| |||
394 | 403 | | |
395 | 404 | | |
396 | 405 | | |
397 | | - | |
| 406 | + | |
398 | 407 | | |
399 | 408 | | |
400 | 409 | | |
| |||
496 | 505 | | |
497 | 506 | | |
498 | 507 | | |
499 | | - | |
| 508 | + | |
500 | 509 | | |
501 | 510 | | |
502 | 511 | | |
503 | 512 | | |
504 | | - | |
| 513 | + | |
505 | 514 | | |
506 | 515 | | |
507 | 516 | | |
| |||
0 commit comments