RFR: 8272609: Add string deduplication support to SerialGC [v2]

Denghui Dong ddong at openjdk.java.net
Thu Aug 19 09:18:22 UTC 2021


On Thu, 19 Aug 2021 05:25:03 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> 
> But it's not obvious that string deduplication support is useful for SerialGC. The kinds of applications SerialGC is often used for don't really benefit from string deduplication. Can someone suggest a good use-case?
> 

In some serverless applications (such as AWS Lambda) scenarios, SerialGC is generally used as the default GC algorithm. If there are many string constructions in the application, I think string deduplication may be beneficial.

> src/hotspot/share/gc/serial/markSweep.hpp line 116:
> 
>> 114:   static SerialOldTracer*                _gc_tracer;
>> 115: 
>> 116:   static StringDedup::Requests _string_dedup_requests;
> 
> Avoid non-local variables with non-trivial / not-constexpr constructors or destructors.  Better would be a pointer to a Requests object that is initially NULL and assigned by an initialization function or per collection, as is done for some of the other nearby variables.  Yes, there are also some variables here that violate this; that's not a reason to add to that collection.  (Note that the Style Guide currently mistakenly refers to "namespace-scoped" rather than "non-local" variables - JDK-8272691.)

Fixed.
I made StringDedup::Requests extends ResourceObj since global operators new and delete is not allowed in Hotspot.

Thanks

-------------

PR: https://git.openjdk.java.net/jdk/pull/5153



More information about the hotspot-gc-dev mailing list