sun.misc.GC Java Examples

The following examples show how to use sun.misc.GC. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectTable.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #2
Source File: DGCClient.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #3
Source File: ObjectTable.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #4
Source File: DGCClient.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #5
Source File: ObjectTable.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #6
Source File: DGCClient.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #7
Source File: ObjectTable.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #8
Source File: DGCClient.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #9
Source File: ObjectTable.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #10
Source File: DGCClient.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #11
Source File: ObjectTable.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #12
Source File: DGCClient.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #13
Source File: ObjectTable.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #14
Source File: DGCClient.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #15
Source File: ObjectTable.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #16
Source File: DGCClient.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #17
Source File: ObjectTable.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #18
Source File: DGCClient.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #19
Source File: ObjectTable.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #20
Source File: DGCClient.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #21
Source File: ObjectTable.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #22
Source File: DGCClient.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}
 
Example #23
Source File: ObjectTable.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Increments the "keep-alive count".
 *
 * The "keep-alive count" is the number of non-permanent remote objects
 * that are either in the object table or still have calls in progress.
 * Therefore, this method should be invoked exactly once for every
 * non-permanent remote object exported (a remote object must be
 * exported before it can have any calls in progress).
 *
 * The VM is "kept alive" while the keep-alive count is greater than
 * zero; this is accomplished by keeping a non-daemon thread running.
 *
 * Because non-permanent objects are those that can be garbage
 * collected while exported, and thus those for which the "reaper"
 * thread operates, the reaper thread also serves as the non-daemon
 * VM keep-alive thread; a new reaper thread is created if necessary.
 */
static void incrementKeepAliveCount() {
    synchronized (keepAliveLock) {
        keepAliveCount++;

        if (reaper == null) {
            reaper = AccessController.doPrivileged(
                new NewThreadAction(new Reaper(), "Reaper", false));
            reaper.start();
        }

        /*
         * While there are non-"permanent" objects in the object table,
         * request a maximum latency for inspecting the entire heap
         * from the local garbage collector, to place an upper bound
         * on the time to discover remote objects that have become
         * unreachable (and thus can be removed from the table).
         */
        if (gcLatencyRequest == null) {
            gcLatencyRequest = GC.requestLatency(gcInterval);
        }
    }
}
 
Example #24
Source File: DGCClient.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Look up the EndpointEntry for the given Endpoint.  An entry is
 * created if one does not already exist.
 */
public static EndpointEntry lookup(Endpoint ep) {
    synchronized (endpointTable) {
        EndpointEntry entry = endpointTable.get(ep);
        if (entry == null) {
            entry = new EndpointEntry(ep);
            endpointTable.put(ep, entry);
            /*
             * While we are tracking live remote references registered
             * in this VM, request a maximum latency for inspecting the
             * entire heap from the local garbage collector, to place
             * an upper bound on the time to discover remote references
             * that have become unreachable (see bugid 4171278).
             */
            if (gcLatencyRequest == null) {
                gcLatencyRequest = GC.requestLatency(gcInterval);
            }
        }
        return entry;
    }
}