This commit enhances the Windows RSS memory retrieval functionality in OsUtils
to provide better compatibility and reliability across different Windows versions.
Key improvements:
- Added multiple fallback strategies for Windows RSS retrieval:
1. PowerShell approach (modern, Windows 7+ with PowerShell 2.0+)
2. WMIC approach (fallback for older systems)
3. Tasklist approach (final fallback, most compatible from XP to Win11)
- Enhanced error handling with debug-level logging for memory queries
to avoid log spam while maintaining visibility for debugging
- Added robust CSV parsing for tasklist output with proper handling
of quoted fields and comma-separated numbers (e.g., '1,234 K')
- Improved regex pattern matching for memory values that handles
various formats returned by Windows commands
- Refactored code structure by separating Unix and Windows logic
into dedicated methods for better maintainability
These changes ensure reliable RSS memory retrieval across all supported
Windows versions while maintaining backward compatibility and improving
error handling.
mvnd still had mvn3 like code, just drop it and let base parser
do the work. All the mvnd needs is filtering.
Discriminating based on XML file hashes.
Fixes#1280
The previous implementation had two issues:
The memmory-mapped file was created in the constructor and ignored file expansions by other
threads or processes. It would then overwrite the file with its own, smaller size buffer.
Replaced the memory mapping with a regular InputStream/OutputStream approach. Memory mapping
is not very useful in this scenario anyway, since the file is small and infrequently read and
we always read/write the entire file.
The tryLock method was broken and only tried locking once. If the lock could not be acquired,
it returned null and the subsequent code then ignored that fact and proceeded without locking.
I've moved the retry loop and failure handling into the lock method, which gives it the intended
behavior of waiting for a lock for 20s and then failing.
The test expectation for the "big registry" test has changed, since we no longer
manually increase the file size to multiples of two, but instead simply write out
exactly the bytes we need.
I droped the String size requirement, since DataInputStream handles arbitrarly
long Strings. I also changed the exception handling to consistently do recovery
on any kind of exception while reading/writing, since it is reasonable to assume
that any such exception indicates a broken registry file. I've also adjusted the
user-facing message to only tell them to delete the file if recovery fails.
Changes:
* no source change
* (build) expel all versions from child modules: they must be all top level depMgmt or pluginMgmt
* (build) Top POM contains GAVs while child modules GA+scope. This tremendously simplifies maintenance.
* (javadoc) fix Javadoc errors
* (build) remove obsolete profiles and mr-JARs, project is 17+
Updates:
* maven wrapper 3.3.2 w/ scripts
Changes:
* parent POM 42
* unset release where needed (makes com.sun pkg unreachable)
* explicitly index as parent disables "implicit" AP
* remove redundtant stuff
* update dependabot to take care of workflow as well (as mvnd uses own)
* fix typo in method names
* add a test for the other *toHumanReadable method
* replace StringBuilder usage with simple concatenation
where applicable (for fixed length strings)
This is mostly for the integration tests of the Gradle Enterprise Maven extension,
which heavily test dependency resolution and reuse the same GAVs in many test,
e.g. a🅱️1.0. It would be a lot of effort to rewrite all those tests and a shame
to restart the daemon every time. So I wanted to ask if you'd consider this flag
to disable the caching altogether.
Use the plexus Launcher to start the daemon server, just like we would
launch a normal Maven process.
This improves compatibility with any extensions or plugins that assume that
their ClassLoader is a ClassRealm.