activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michaelandrepearce <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1752: ARTEMIS-1586 Reduce GC pressure due to ...
Date Fri, 05 Jan 2018 20:59:10 GMT
Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1752#discussion_r159978720
  
    --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/utils/AbstractInterner.java
---
    @@ -0,0 +1,157 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements. See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License. You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.activemq.artemis.utils;
    +
    +import io.netty.buffer.ByteBuf;
    +import io.netty.util.internal.MathUtil;
    +import io.netty.util.internal.PlatformDependent;
    +
    +/**
    + * Thread-safe {@code <T>} interner.
    + * <p>
    + * Differently from {@link String#intern()} it contains a fixed amount of entries and
    + * when used by concurrent threads it doesn't ensure the uniqueness of the entries ie
    + * the same entry could be allocated multiple times by concurrent calls.
    + */
    +public abstract class AbstractInterner<T> {
    +
    +   private final T[] entries;
    --- End diff --
    
    this doesn't allow GC to occur ever on any object held by this class, if the object is
de-referenced. 


---

Mime
View raw message