Skip to content

Commit

Permalink
Use BigInteger for MemoryStats.hierarchicalMemoryLimit
Browse files Browse the repository at this point in the history
Some computers will have more memory limits higher than
Long can represent.

This was breaking DefaultDockerClientTest.testStats() on some hosts.
  • Loading branch information
davidxia committed Sep 23, 2016
1 parent aaa169b commit 95ffdbc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.math.BigInteger;
import java.util.Objects;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY;
Expand Down Expand Up @@ -108,7 +109,7 @@ public static class Stats {
@JsonProperty("total_writeback") private Long totalWriteback;
@JsonProperty("total_inactive_anon") private Long totalInactiveAnon;
@JsonProperty("rss_huge") private Long rssHuge;
@JsonProperty("hierarchical_memory_limit") private Long hierarchicalMemoryLimit;
@JsonProperty("hierarchical_memory_limit") private BigInteger hierarchicalMemoryLimit;
@JsonProperty("total_pgfault") private Long totalPgfault;
@JsonProperty("total_active_file") private Long totalActiveFile;
@JsonProperty("active_anon") private Long activeAnon;
Expand Down Expand Up @@ -189,7 +190,7 @@ public Long rssHuge() {
return rssHuge;
}

public Long hierarchicalMemoryLimit() {
public BigInteger hierarchicalMemoryLimit() {
return hierarchicalMemoryLimit;
}

Expand Down

0 comments on commit 95ffdbc

Please sign in to comment.