Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide by zero error in JVM metrics sampler #57

Closed
emlyn opened this issue Jan 12, 2021 · 1 comment
Closed

Divide by zero error in JVM metrics sampler #57

emlyn opened this issue Jan 12, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@emlyn
Copy link
Contributor

emlyn commented Jan 12, 2021

I got a divide by zero error from the JVM metrics sampler when running low on memory.
Here's a stack trace (from version 0.5.0):

 [[clojure.lang.Numbers divide "Numbers.java" 188]
  [clojure.lang.Numbers divide "Numbers.java" 3901]
  [com.brunobonacci.mulog.publishers.jvm_metrics$capture_memory_pools$iter__263__267$fn__268$fn__269 invoke "jvm_metrics.clj" 144]
  [com.brunobonacci.mulog.publishers.jvm_metrics$capture_memory_pools$iter__263__267$fn__268 invoke "jvm_metrics.clj" 139]
  [clojure.lang.LazySeq sval "LazySeq.java" 42]
  [clojure.lang.LazySeq seq "LazySeq.java" 51]
  [clojure.lang.RT seq "RT.java" 535]
  [clojure.core$seq__5402 invokeStatic "core.clj" 137]
  [clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 24]
  [clojure.core.protocols$fn__8146 invokeStatic "protocols.clj" 75]
  [clojure.core.protocols$fn__8146 invoke "protocols.clj" 75]
  [clojure.core.protocols$fn__8088$G__8083__8101 invoke "protocols.clj" 13]
  [clojure.core$reduce invokeStatic "core.clj" 6828]
  [clojure.core$into invokeStatic "core.clj" 6895]
  [clojure.core$into invoke "core.clj" 6887]
  [com.brunobonacci.mulog.publishers.jvm_metrics$capture_memory_pools invokeStatic "jvm_metrics.clj" 138]
  [com.brunobonacci.mulog.publishers.jvm_metrics$capture_memory_pools invoke "jvm_metrics.clj" 137]
  [com.brunobonacci.mulog.publishers.jvm_metrics$jvm_sample_memory invokeStatic "jvm_metrics.clj" 257]
  [com.brunobonacci.mulog.publishers.jvm_metrics$jvm_sample_memory invoke "jvm_metrics.clj" 249]
  [com.brunobonacci.mulog.publishers.jvm_metrics$jvm_sample_memory invokeStatic "jvm_metrics.clj" 252]
  [com.brunobonacci.mulog.publishers.jvm_metrics$jvm_sample_memory invoke "jvm_metrics.clj" 249]
  [com.brunobonacci.mulog.publishers.jvm_metrics$jvm_sample invokeStatic "jvm_metrics.clj" 310]
  [com.brunobonacci.mulog.publishers.jvm_metrics$jvm_sample invoke "jvm_metrics.clj" 286]
  [com.brunobonacci.mulog.publishers.jvm_metrics.JvmMetricsPublisher publish "jvm_metrics.clj" 336]
  [com.brunobonacci.mulog.core$start_publisher_BANG_$publish_attempt__6733 invoke "core.clj" 190]
  [clojure.core$binding_conveyor_fn$fn__5754 invoke "core.clj" 2033]
  [clojure.lang.AFn applyToHelper "AFn.java" 154]
  [clojure.lang.RestFn applyTo "RestFn.java" 132]
  [clojure.lang.Agent$Action doRun "Agent.java" 114]
  [clojure.lang.Agent$Action run "Agent.java" 163]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1149]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 624]
  [java.lang.Thread run "Thread.java" 748]]},

It might be an idea to check for a zero denominator in capture-memory-pools and handle it gracefully.

@BrunoBonacci BrunoBonacci self-assigned this Jan 12, 2021
@BrunoBonacci BrunoBonacci added the bug Something isn't working label Jan 12, 2021
@BrunoBonacci
Copy link
Owner

released in v0.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants