Skip to content

Conversation

gnodet
Copy link
Contributor

@gnodet gnodet commented Jun 24, 2025

This comprehensive enhancement to Maven's caching system addresses memory issues and significantly improves performance through several key improvements.

Key Features:

  • Enhanced DefaultRequestCache with configurable reference types and CSS-like selectors
  • Pluggable ModelObjectPool service architecture with configurable object types
  • Comprehensive cache statistics with eviction tracking and configurable display
  • Improved InputLocation and InputSource with ImmutableCollections and factory methods
  • Custom equality strategy for Dependency pooling to reduce memory footprint
  • Enhanced parent request matching with interface checking for better cache hits
  • Configurable cache statistics display for monitoring and debugging
  • XML factory caching for improved parsing performance

Technical Highlights:

  • Cache Configuration: CSS-like selectors for fine-grained cache control
  • Reference Types: Configurable HARD/SOFT/WEAK references for optimal memory management
  • Statistics: Comprehensive eviction and hit/miss tracking
  • Object Pooling: Reduces duplicate object creation for common Maven model objects
  • Immutable Collections: Reduces memory overhead and improves cache efficiency

@gnodet gnodet force-pushed the feature/improve-cache branch from 48385ea to 087a13a Compare June 24, 2025 20:20
@gnodet gnodet closed this Jun 26, 2025
@gnodet gnodet deleted the feature/improve-cache branch June 26, 2025 06:21
@gnodet gnodet reopened this Jun 26, 2025
@gnodet gnodet changed the title Feature/improve cache Improve Maven cache architecture for better memory efficiency and performance Jun 29, 2025
@gnodet gnodet force-pushed the feature/improve-cache branch 2 times, most recently from 60e48b1 to 888ab92 Compare June 29, 2025 19:25
gnodet added a commit to gnodet/maven that referenced this pull request Jun 29, 2025
- Remove CacheMapAdapter.java as it's no longer needed
- Update DefaultRequestCache to use Cache<K,V> directly instead of Map adapter
- Update AbstractSession to use Cache for all internal caching:
  * services cache: Map -> Cache
  * allNodes cache: WeakHashMap -> Cache
  * allArtifacts cache: ConcurrentHashMap<Class, Map> -> Cache<Class, Cache>
  * allRepositories cache: WeakHashMap -> Cache
  * allDependencies cache: WeakHashMap -> Cache
- This brings the implementation closer to the original PR apache#2506
- All 12 cache tests continue to pass
- Maintains thread safety and memory efficiency with soft references
gnodet added a commit to gnodet/maven that referenced this pull request Jun 29, 2025
This change brings the implementation closer to the original PR apache#2506 by:

1. **Removed CacheMapAdapter**: Eliminated the adapter layer that was converting
   between Map and Cache interfaces, simplifying the architecture.

2. **Updated DefaultRequestCache**: Changed from using Map<Object, CachingSupplier<?, ?>>
   to Cache<Object, CachingSupplier<?, ?>> directly, removing the need for adapters.

3. **Updated AbstractSession**: Replaced all Map-based caches with Cache interface:
   - services: Map<Class<? extends Service>, Service> → Cache<Class<? extends Service>, Service>
   - allNodes: WeakHashMap<DependencyNode, Node> → Cache<DependencyNode, Node>
   - allArtifacts: ConcurrentHashMap<Class, Map<Artifact, Artifact>> → Cache<Class, Cache<Artifact, Artifact>>
   - allRepositories: WeakHashMap<RemoteRepository, RemoteRepository> → Cache<RemoteRepository, RemoteRepository>
   - allDependencies: WeakHashMap<Dependency, Dependency> → Cache<Dependency, Dependency>

**Benefits:**
- **Consistent caching**: All caches now use the same modern Cache implementation
- **Better memory management**: Soft references throughout instead of mixed approaches
- **Thread safety**: All caches benefit from the thread-safe DefaultCache implementation
- **Simplified architecture**: Removed unnecessary adapter layer
- **Closer to original vision**: Uses Cache<K,V> consistently as intended in PR apache#2506

**Verification:**
- ✅ All 12 cache tests pass
- ✅ Maven-impl module builds successfully
- ✅ Maintains backward compatibility through the Cache interface

This change focuses on the core cache infrastructure in maven-impl. Additional
cache classes in maven-core can be updated in a separate effort.
@gnodet gnodet added this to the 4.1.0 milestone Jun 30, 2025
@gnodet gnodet marked this pull request as ready for review July 1, 2025 09:00
gnodet added a commit to gnodet/maven that referenced this pull request Jul 15, 2025
Analysis of the working PR apache#2506 revealed that the key difference is the use
of WEAK references instead of SOFT references for cache entries.

Root Cause:
- SOFT references are only cleared when JVM is close to OutOfMemoryError
- This causes excessive memory retention and can lead to OOM in large builds
- WEAK references are cleared much more aggressively when objects are no longer
  strongly referenced, preventing memory buildup

Changes:
- Switch from SoftReference to WeakReference for both keys and values
- Update documentation to reflect the change from soft to weak references
- This aligns with the working PR apache#2506 which uses Cache.ReferenceType.WEAK

Benefits:
- Prevents OOM issues in integration tests and large builds
- Maintains caching benefits while allowing more aggressive garbage collection
- Follows the proven approach from the comprehensive PR apache#2506

All 12 cache tests continue to pass with this change.
gnodet added a commit to gnodet/maven that referenced this pull request Jul 15, 2025
This commit removes the following components from the comprehensive PR apache#2506:
- CacheConfigurationResolver and related configuration classes
- CacheStatistics and related statistics tracking
- Cache configuration parsing and system property handling
- Factory methods from InputSource and InputLocation (merge methods)
- Complex object pooling configuration (keeping only Dependency pooling)

Remaining work:
- Fix compilation errors for missing interfaces
- Adapt to current master branch API structure
- Ensure all tests pass

This trimmed version keeps the core cache improvements while removing
the configuration complexity that's not needed for the 4.0.x branch.
gnodet added a commit to gnodet/maven that referenced this pull request Jul 16, 2025
This commit removes the following components from the comprehensive PR apache#2506:
- CacheConfigurationResolver and related configuration classes
- CacheStatistics and related statistics tracking
- Cache configuration parsing and system property handling
- Factory methods from InputSource and InputLocation (merge methods)
- Complex object pooling configuration (keeping only Dependency pooling)

Remaining work:
- Fix compilation errors for missing interfaces
- Adapt to current master branch API structure
- Ensure all tests pass

This trimmed version keeps the core cache improvements while removing
the configuration complexity that's not needed for the 4.0.x branch.
gnodet added a commit to gnodet/maven that referenced this pull request Jul 17, 2025
This commit removes the following components from the comprehensive PR apache#2506:
- CacheConfigurationResolver and related configuration classes
- CacheStatistics and related statistics tracking
- Cache configuration parsing and system property handling
- Factory methods from InputSource and InputLocation (merge methods)
- Complex object pooling configuration (keeping only Dependency pooling)

Remaining work:
- Fix compilation errors for missing interfaces
- Adapt to current master branch API structure
- Ensure all tests pass

This trimmed version keeps the core cache improvements while removing
the configuration complexity that's not needed for the 4.0.x branch.
@gnodet gnodet force-pushed the feature/improve-cache branch 2 times, most recently from a1ab28e to 73b1fe8 Compare July 17, 2025 09:11
gnodet added a commit to gnodet/maven that referenced this pull request Jul 17, 2025
This commit removes the following components from the comprehensive PR apache#2506:
- CacheConfigurationResolver and related configuration classes
- CacheStatistics and related statistics tracking
- Cache configuration parsing and system property handling
- Factory methods from InputSource and InputLocation (merge methods)
- Complex object pooling configuration (keeping only Dependency pooling)

Remaining work:
- Fix compilation errors for missing interfaces
- Adapt to current master branch API structure
- Ensure all tests pass

This trimmed version keeps the core cache improvements while removing
the configuration complexity that's not needed for the 4.0.x branch.

# Conflicts:
#	impl/maven-impl/src/main/java/org/apache/maven/impl/cache/DefaultRequestCache.java
#	impl/maven-impl/src/main/java/org/apache/maven/impl/model/DefaultModelObjectPool.java
#	impl/maven-impl/src/test/java/org/apache/maven/impl/cache/ReferenceTypeStatisticsTest.java
}

public static InputLocation of(int lineNumber, int columnNumber) {
return new InputLocation(lineNumber, columnNumber);
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of those have reasons for doing this that simply don't apply here. This does nothing the existing constructor doesn't do, and just adds code and API complexity. When the basics work, stick to the basics.

elharo
elharo previously requested changes Jul 17, 2025
}

public static InputLocation of(int lineNumber, int columnNumber) {
return new InputLocation(lineNumber, columnNumber);
Copy link
Contributor

Choose a reason for hiding this comment

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

Better yet, just don't deprecate the constructors and don't introduce factory methods. Effective Java lists 4 reasons to consider factory methods. Exactly zero of those apply here. In fact, rereading that chapter I notice that one of the reasons is so that constructors with different arguments have meaningful, dissimilar names. And yet here all four methods are named the undescriptive "of".

Plugging in ModelObjectPool could be a reason to use factory methods, but this PR isn't doing that.

@gnodet gnodet force-pushed the feature/improve-cache branch 4 times, most recently from d07426b to 5bf21df Compare July 24, 2025 14:36
@gnodet
Copy link
Contributor Author

gnodet commented Jul 24, 2025

@elharo hopefully, laid out this way, you'll understand why the static factory method pattern makes more sense for the location tracking classes.

@gnodet gnodet force-pushed the feature/improve-cache branch from 5bf21df to dee7262 Compare August 27, 2025 06:19
@cstamas
Copy link
Member

cstamas commented Sep 22, 2025

Is this to be revived?

@gnodet
Copy link
Contributor Author

gnodet commented Sep 22, 2025

Is this to be revived?

Could be. I need to rebase on latest master and run the tests at https://github.com/gnodet/maven-bench to get proper results.

…formance

This comprehensive enhancement to Maven's caching system addresses memory issues
and significantly improves performance through several key improvements:

- Enhanced DefaultRequestCache with configurable reference types and CSS-like selectors
- Pluggable ModelObjectPool service architecture with configurable object types
- Comprehensive cache statistics with eviction tracking
- Improved InputLocation and InputSource with ImmutableCollections
- Custom equality strategy for Dependency pooling
- Enhanced parent request matching with interface checking
- Configurable cache statistics display

- Maven 3: Requires -Xmx1536m, runs in 45 seconds
- Maven 4.0.0-rc-4: Runs with -Xmx1024m in 2'32" (cannot run with -Xmx512m)
- Maven 4.0.0-rc-4 with -Xmx1536m: 2'5"
- Maven 4.0.0-rc-4 + maven3Personality with -Xmx1536m: 1'14"
- Maven 4 + this PR: Runs with -Xmx512m in 3'42" (more memory does not help)
- Maven 4 + this PR + maven3Personality: Runs with -Xmx512m in 1'0"

- Reduced minimum memory requirement from 1024m to 512m
- Eliminated memory scaling issues - additional memory beyond 512m provides no benefit
- Significant reduction in memory pressure through improved caching strategies

This PR definitively solves memory problems while maintaining or improving performance.
@gnodet gnodet force-pushed the feature/improve-cache branch from dee7262 to ad062e9 Compare September 22, 2025 12:01
Remove unused imports:
- WeakHashMap from AbstractSession.java
- InputSource from DefaultModelBuilder.java

These imports were not being used and were flagged by spotless during the rebase process.
The project has removed the Hamcrest dependency, so we need to replace:
- assertThat(value, greaterThan(0)) with assertTrue(value > 0)
- assertThat(value, containsString(text)) with assertTrue(value.contains(text))
- assertThat(message, value, matcher) with assertTrue(condition, message)

This ensures compatibility with the current Maven codebase that no longer includes Hamcrest.
Improve test failure diagnostics by adding meaningful error messages to assertions:

- Profile location null checks now include profile ID in error message
- Line/column number assertions show actual values and profile context
- Source location assertions display expected vs actual paths
- External profile assertions clearly identify the profile being tested

These improvements will make debugging test failures much easier by providing:
- Clear context about which profile is failing
- Actual values that caused the assertion to fail
- Expected vs actual comparisons for path assertions
- Distinction between POM-based and external profiles

This enhances the developer experience when tests fail and makes it easier
to identify the root cause of assertion failures.
@gnodet
Copy link
Contributor Author

gnodet commented Sep 22, 2025

Summary

Maven Performance Analysis

Standard Maven Versions Comparison

Memory Setting Maven 3 Maven 4 RC-4 Maven 4 Master Maven 4 Current
512MB FAILED FAILED FAILED ✅ 2:41 (943MB)
1024MB FAILED ✅ 4:06 (1418MB) ✅ 1:59 (1433MB) ✅ 1:24 (1357MB)
1536MB ✅ 0:55 (1920MB) ✅ 3:29 (1865MB) ✅ 1:29 (1913MB) ✅ 1:19 (1836MB)
2048MB ✅ 1:12 (2422MB) ✅ 2:30 (2354MB) ✅ 2:18 (2364MB) ✅ 2:02 (2282MB)

Key Findings (Standard Versions):

  • Maven 3: Fastest execution times (55 seconds - 1:12) but requires minimum 1536MB to run successfully
  • Maven 4 RC-4: Requires minimum 1024MB, slowest performance (4:06 at 1024MB, improves with more memory)
  • Maven 4 Master: Good balance - runs with 1024MB and has reasonable performance (1:59-2:18)
  • Maven 4 Current: Only version that works with 512MB, best overall performance among Maven 4 variants

Maven3-Personality Versions Comparison

Memory Setting Maven 3 Maven 4 RC-4 Maven 4 Master Maven 4 Current
512MB FAILED FAILED FAILED ✅ 1:02 (876MB)
1024MB FAILED ✅ 1:21 (1319MB) ✅ 1:16 (1368MB) ✅ 0:51 (1335MB)
1536MB ✅ 0:55 (1920MB) ✅ 2:04 (1850MB) ✅ 1:45 (1883MB) ✅ 0:47 (1874MB)
2048MB ✅ 1:12 (2422MB) ✅ 2:03 (2325MB) ✅ 0:48 (2382MB) ✅ 0:47 (2369MB)

Key Findings (Maven3-Personality):

  • Maven3-personality dramatically improves performance across all Maven 4 versions
  • Maven 4 Current + Maven3-personality: Best overall performance and only combination that works reliably with 512MB
  • Maven 4 Master + Maven3-personality: Excellent performance at higher memory settings (48 seconds at 2048MB)
  • All Maven3-personality versions show significantly faster execution times compared to their standard counterparts

Performance Impact Analysis

Memory Efficiency:

  • Maven 4 Current is the most memory-efficient, working with just 512MB in both standard and maven3-personality modes
  • Maven 3 requires the most memory (1536MB minimum) but uses it efficiently
  • Maven3-personality significantly reduces execution times without increasing memory requirements

Execution Speed:

  • Maven 3: Still fastest when it works (55 seconds - 1:12 minutes with sufficient memory)
  • Maven 4 Current + Maven3-personality: Best Maven 4 performance (47-62 seconds)
  • Maven 4 Master + Maven3-personality: Excellent at higher memory (48 seconds at 2048MB)
  • Standard Maven 4 versions: Generally slower, with RC-4 being the slowest

Maven3-Personality Impact:

The Maven3-personality configuration provides:

  • Dramatic performance improvements across all Maven 4 versions (50-75% faster in many cases)
  • Better resource utilization without increased memory consumption
  • Consistent performance gains across all memory configurations
  • Makes Maven 4 competitive with Maven 3's performance characteristics

Current Maven 4 Advantages:

Maven 4 Current demonstrates:

  • Best memory efficiency (only version working at 512MB)
  • Excellent performance when combined with Maven3-personality
  • Most reliable execution across different memory constraints
  • Optimal balance of memory usage and execution speed

Results

======================================================================
                    MAVEN PERFORMANCE BENCHMARK RESULTS
======================================================================

Configuration                            Memory Req.  Exec. Time   Peak Mem.    Status
------------------------------------------------------------------------------
maven3_512m                              -Xmx512m     FAILED       682MB        💥
maven3_512m                              -Xmx512m     FAILED       704MB        💥
maven3_512m                              -Xmx512m     FAILED       724MB        💥
maven3_512m                              -Xmx512m     FAILED       0MB          ✗
maven3_1024m                             -Xmx1024m    FAILED       1236MB       💥
maven3_1024m                             -Xmx1024m    FAILED       1237MB       💥
maven3_1024m                             -Xmx1024m    FAILED       1233MB       💥
maven3_1024m                             -Xmx1024m    FAILED       0MB          ✗
maven3_1536m                             -Xmx1536m    0:58         1901MB       ✓
maven3_1536m                             -Xmx1536m    0:55         1938MB       ✓
maven3_1536m                             -Xmx1536m    0:54         1920MB       ✓
maven3_1536m                             -Xmx1536m    0:55         1919MB       ✓
maven3_2048m                             -Xmx2048m    1:18         2374MB       ✓
maven3_2048m                             -Xmx2048m    1:12         2444MB       ✓
maven3_2048m                             -Xmx2048m    1:08         2447MB       ✓
maven3_2048m                             -Xmx2048m    1:12         2421MB       ✓
maven4-rc4_512m                          -Xmx512m     FAILED       863MB        💥
maven4-rc4_512m                          -Xmx512m     FAILED       972MB        💥
maven4-rc4_512m                          -Xmx512m     FAILED       859MB        💥
maven4-rc4_512m                          -Xmx512m     FAILED       0MB          ✗
maven4-rc4_1024m                         -Xmx1024m    4:06         1401MB       ✓
maven4-rc4_1024m                         -Xmx1024m    4:06         1429MB       ✓
maven4-rc4_1024m                         -Xmx1024m    4:06         1423MB       ✓
maven4-rc4_1024m                         -Xmx1024m    4:06         1417MB       ✓
maven4-rc4_1536m                         -Xmx1536m    3:30         1854MB       ✓
maven4-rc4_1536m                         -Xmx1536m    3:30         1870MB       ✓
maven4-rc4_1536m                         -Xmx1536m    3:28         1872MB       ✓
maven4-rc4_1536m                         -Xmx1536m    3:29         1865MB       ✓
maven4-rc4_2048m                         -Xmx2048m    2:29         2325MB       ✓
maven4-rc4_2048m                         -Xmx2048m    2:32         2372MB       ✓
maven4-rc4_2048m                         -Xmx2048m    2:30         2365MB       ✓
maven4-rc4_2048m                         -Xmx2048m    2:30         2354MB       ✓
maven4-master_512m                       -Xmx512m     FAILED       877MB        💥
maven4-master_512m                       -Xmx512m     FAILED       864MB        💥
maven4-master_512m                       -Xmx512m     FAILED       882MB        💥
maven4-master_512m                       -Xmx512m     FAILED       0MB          ✗
maven4-master_1024m                      -Xmx1024m    1:59         1418MB       ✓
maven4-master_1024m                      -Xmx1024m    2:00         1461MB       ✓
maven4-master_1024m                      -Xmx1024m    1:59         1421MB       ✓
maven4-master_1024m                      -Xmx1024m    1:59         1433MB       ✓
maven4-master_1536m                      -Xmx1536m    1:32         1887MB       ✓
maven4-master_1536m                      -Xmx1536m    1:28         1897MB       ✓
maven4-master_1536m                      -Xmx1536m    1:29         1957MB       ✓
maven4-master_1536m                      -Xmx1536m    1:29         1913MB       ✓
maven4-master_2048m                      -Xmx2048m    2:13         2362MB       ✓
maven4-master_2048m                      -Xmx2048m    2:20         2353MB       ✓
maven4-master_2048m                      -Xmx2048m    2:22         2376MB       ✓
maven4-master_2048m                      -Xmx2048m    2:18         2363MB       ✓
maven4-current_512m                      -Xmx512m     2:40         910MB        ✓
maven4-current_512m                      -Xmx512m     2:38         949MB        ✓
maven4-current_512m                      -Xmx512m     2:46         969MB        ✓
maven4-current_512m                      -Xmx512m     2:41         942MB        ✓
maven4-current_1024m                     -Xmx1024m    1:23         1347MB       ✓
maven4-current_1024m                     -Xmx1024m    1:24         1390MB       ✓
maven4-current_1024m                     -Xmx1024m    1:24         1334MB       ✓
maven4-current_1024m                     -Xmx1024m    1:23         1357MB       ✓
maven4-current_1536m                     -Xmx1536m    1:17         1846MB       ✓
maven4-current_1536m                     -Xmx1536m    1:21         1832MB       ✓
maven4-current_1536m                     -Xmx1536m    1:20         1831MB       ✓
maven4-current_1536m                     -Xmx1536m    1:19         1836MB       ✓
maven4-current_2048m                     -Xmx2048m    2:04         2286MB       ✓
maven4-current_2048m                     -Xmx2048m    1:58         2285MB       ✓
maven4-current_2048m                     -Xmx2048m    2:03         2276MB       ✓
maven4-current_2048m                     -Xmx2048m    2:01         2282MB       ✓
maven4-rc4_512m_maven3personality        -Xmx512m     FAILED       881MB        💥
maven4-rc4_512m_maven3personality        -Xmx512m     FAILED       889MB        💥
maven4-rc4_512m_maven3personality        -Xmx512m     FAILED       836MB        💥
maven4-rc4_512m_maven3personality        -Xmx512m     FAILED       0MB          ✗
maven4-rc4_1024m_maven3personality       -Xmx1024m    1:17         1327MB       ✓
maven4-rc4_1024m_maven3personality       -Xmx1024m    1:26         1338MB       ✓
maven4-rc4_1024m_maven3personality       -Xmx1024m    1:19         1292MB       ✓
maven4-rc4_1024m_maven3personality       -Xmx1024m    1:20         1319MB       ✓
maven4-rc4_1536m_maven3personality       -Xmx1536m    2:03         1866MB       ✓
maven4-rc4_1536m_maven3personality       -Xmx1536m    2:03         1859MB       ✓
maven4-rc4_1536m_maven3personality       -Xmx1536m    2:05         1824MB       ✓
maven4-rc4_1536m_maven3personality       -Xmx1536m    2:03         1849MB       ✓
maven4-rc4_2048m_maven3personality       -Xmx2048m    1:58         2312MB       ✓
maven4-rc4_2048m_maven3personality       -Xmx2048m    2:06         2338MB       ✓
maven4-rc4_2048m_maven3personality       -Xmx2048m    2:05         2325MB       ✓
maven4-rc4_2048m_maven3personality       -Xmx2048m    2:03         2325MB       ✓
maven4-master_512m_maven3personality     -Xmx512m     FAILED       840MB        💥
maven4-master_512m_maven3personality     -Xmx512m     FAILED       880MB        💥
maven4-master_512m_maven3personality     -Xmx512m     FAILED       872MB        💥
maven4-master_512m_maven3personality     -Xmx512m     FAILED       0MB          ✗
maven4-master_1024m_maven3personality    -Xmx1024m    FAILED       1204MB       ✗
maven4-master_1024m_maven3personality    -Xmx1024m    FAILED       1215MB       ✗
maven4-master_1024m_maven3personality    -Xmx1024m    1:16         1368MB       ✓
maven4-master_1024m_maven3personality    -Xmx1024m    1:16         1368MB       ✓
maven4-master_1536m_maven3personality    -Xmx1536m    1:43         1887MB       ✓
maven4-master_1536m_maven3personality    -Xmx1536m    1:45         1893MB       ✓
maven4-master_1536m_maven3personality    -Xmx1536m    1:47         1868MB       ✓
maven4-master_1536m_maven3personality    -Xmx1536m    1:45         1882MB       ✓
maven4-master_2048m_maven3personality    -Xmx2048m    0:44         2353MB       ✓
maven4-master_2048m_maven3personality    -Xmx2048m    0:50         2395MB       ✓
maven4-master_2048m_maven3personality    -Xmx2048m    0:49         2399MB       ✓
maven4-master_2048m_maven3personality    -Xmx2048m    0:47         2382MB       ✓
maven4-current_512m_maven3personality    -Xmx512m     1:04         908MB        ✓
maven4-current_512m_maven3personality    -Xmx512m     1:03         857MB        ✓
maven4-current_512m_maven3personality    -Xmx512m     0:58         865MB        ✓
maven4-current_512m_maven3personality    -Xmx512m     1:01         876MB        ✓
maven4-current_1024m_maven3personality   -Xmx1024m    0:52         1320MB       ✓
maven4-current_1024m_maven3personality   -Xmx1024m    0:52         1358MB       ✓
maven4-current_1024m_maven3personality   -Xmx1024m    0:50         1328MB       ✓
maven4-current_1024m_maven3personality   -Xmx1024m    0:51         1335MB       ✓
maven4-current_1536m_maven3personality   -Xmx1536m    0:48         1876MB       ✓
maven4-current_1536m_maven3personality   -Xmx1536m    0:46         1891MB       ✓
maven4-current_1536m_maven3personality   -Xmx1536m    0:48         1854MB       ✓
maven4-current_1536m_maven3personality   -Xmx1536m    0:47         1873MB       ✓
maven4-current_2048m_maven3personality   -Xmx2048m    0:46         2358MB       ✓
maven4-current_2048m_maven3personality   -Xmx2048m    0:47         2365MB       ✓
maven4-current_2048m_maven3personality   -Xmx2048m    0:47         2383MB       ✓
maven4-current_2048m_maven3personality   -Xmx2048m    0:46         2368MB       ✓
------------------------------------------------------------------------------

Legend:
  ✓ = Successful build
  ✗ = Failed build
  💥 = Out of Memory Error
  ⏰ = Timeout (30 minutes)

Notes:
  - All tests run with: mvn clean install
  - Memory settings: -Xmx and -Xms set to same value
  - JVM: OpenJDK 21 with G1GC
  - Maven3 personality: -Dmaven.maven3Personality=true
  - Peak Memory: Maximum RSS usage during build

@gnodet gnodet requested a review from elharo September 23, 2025 20:43
softMap.size();
}

// The map should eventually clean up the garbage collected entries
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this to a separate test suite or IT or something? I really don't want to introduce known flaky tests

@elharo elharo dismissed their stale review September 24, 2025 12:18

PR continuing

@cstamas
Copy link
Member

cstamas commented Sep 24, 2025

This is awesome

@gnodet gnodet added the enhancement New feature or request label Sep 29, 2025
@gnodet gnodet merged commit 731700a into apache:master Sep 29, 2025
36 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants