Netflix Application Monitoring Library
Java Shell
Clone or download
brharrington avoid mem leak for improper use of registerObject (#451)
Calling `Monitors.registerObject` with a monitor such as
a `BasicCounter` instance will register an empty composite
monitor with an id like `default:class=BasicCounter`. When
using the spectator integration this would result is a
memory leak because it needs to track the instances to be
able to aggregate the results.

This change updates the registration to remove any previous
copies and overwrite which is the default for servo. It also
double checks if it is an empty basic composite and just
ignores those since they will never have any monitors to

It is a bit difficult to test without a bunch of reflection
to dig into the guts of the meter state. I did reproduce in
a debugger using the following test case and confirm the
state is no longer growing:

public void testBasicCounterLoop() {
  for (int i = 0; i < 1000; ++i) {
    BasicCounter c = new BasicCounter(CONFIG);
  assertEquals(1000, registry.counter(ID).count());
Latest commit 72c68e9 Jun 28, 2018
Failed to load latest commit information.
codequality Update PMD to fix InvalidSlf4jMessageFormat: NPE (#446) May 16, 2018
gradle/wrapper update to nebula 5 and gradle 4.4 (#435) Jan 8, 2018
servo-apache Update PMD to fix InvalidSlf4jMessageFormat: NPE (#446) May 16, 2018
servo-atlas add Automatic-Module-Name to manifest (#442) Jan 27, 2018
servo-aws Update PMD to fix InvalidSlf4jMessageFormat: NPE (#446) May 16, 2018
servo-core avoid mem leak for improper use of registerObject (#451) Jun 29, 2018
servo-example Update PMD to fix InvalidSlf4jMessageFormat: NPE (#446) May 16, 2018
servo-graphite add Automatic-Module-Name to manifest (#442) Jan 27, 2018
servo-tomcat add Automatic-Module-Name to manifest (#442) Jan 27, 2018
.gitignore Constante has been replaced by Enum - it looks better May 20, 2014
.netflixoss setup travis build Aug 7, 2015
.travis.yml fix name of publish env variable (#440) Jan 17, 2018 add link to release page Jan 22, 2015 clarify build and test steps Dec 17, 2014
LICENSE Restructure into smaller files Apr 2, 2012
LICENSE.txt Added files. Jan 10, 2012
NOTICE.txt tiny, tiny change :) Apr 2, 2014
OSSMETADATA clarify project status Jan 8, 2018 clarify project status Jan 8, 2018
build.gradle Poll gauge values less frequently (#447) May 17, 2018 enable CI builds for jdk8 and jdk9 Oct 11, 2017 update dependencies Jan 17, 2018 remove version from Dec 3, 2015
gradlew Upgrading to Gradle 1.4 Mar 22, 2013
gradlew.bat Upgrade to Gradle 1.1. Aug 17, 2012 setup travis build Aug 7, 2015
settings.gradle Migrate servo to java 8 Aug 5, 2015


This project receives minimal maintenance to keep software that relies on it working. There is no active development or planned feature improvement. For any new projects it is recommended to use the Spectator library instead.

For more details see the Servo comparison page in the Spectator docs.

Servo: Application Metrics in Java



Servo provides a simple interface for exposing and publishing application metrics in Java. The primary goals are:

  • Leverage JMX: JMX is the standard monitoring interface for Java and can be queried by many existing tools.
  • Keep It Simple: It should be trivial to expose metrics and publish metrics without having to write lots of code such as MBean interfaces.
  • Flexible Publishing: Once metrics are exposed, it should be easy to regularly poll the metrics and make them available for internal reporting systems, logs, and services like Amazon CloudWatch.

This has already been implemented inside of Netflix and most of our applications currently use it.

Project Details

Build Status

Build Status


Servo is released with a 0.X.Y version because it has not yet reached full API stability.

Given a version number MAJOR.MINOR.PATCH, increment the:

  • MINOR version when there are binary incompatible changes, and
  • PATCH version when new functionality or bug fixes are backwards compatible.



Project Usage


To build the Servo project:

$ git clone
$ cd servo
$ ./gradlew build

More details can be found on the Getting Started page of the wiki.


Binaries and dependency information can be found at Maven Central.

Maven Example:


Ivy Example:

<dependency org="" name="servo-core" rev="0.12.7" />


Copyright 2012-2016 Netflix, Inc.

Licensed 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:

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.