欢迎!请参阅关于页面了解有关如何使用此服务的更多信息。
我们的服务器正在经历内存泄露。为了调查发生了什么,我使用jmap导出JVM并获得了以下文件
jmap
No dump file specified num #instances #bytes class name (module) ------------------------------------------------------- 1: 904887 79630056 java.lang.reflect.Method ([email protected]) 2: 935204 50874608 [Ljava.lang.Object; ([email protected]) 3: 889710 47099400 [B ([email protected]) 4: 85795 26006880 [C ([email protected]) 5: 518846 22286056 [I ([email protected]) 6: 781108 18746592 java.lang.String ([email protected]) 7: 382891 15315640 java.math.BigInteger ([email protected]) 8: 370774 14830960 java.math.BigDecimal ([email protected]) 9: 153329 12266320 java.lang.reflect.Constructor ([email protected]) ... 152: 1665 146520 java.util.regex.Pattern ([email protected]) 153: 3638 145520 com.newrelic.agent.deps.org.objectweb.asm.tree.LdcInsnNode 154: 9043 144688 exchange.api.restful.orders$fn__48874$fn__48879 155: 9043 144688 exchange.api.restful.orders$fn__48874$fn__48881 156: 9043 144688 exchange.api.restful.orders$fn__48874$fn__48883 157: 9043 144688 exchange.api.restful.orders$fn__48874$fn__48885 158: 9043 144688 exchange.api.restful.orders$fn__48874$fn__48887 159: 9043 144688 exchange.api.restful.orders$fn__48874$fn__48892 160: 9006 144096 java.util.Formatter$Flags ([email protected]) 161: 8973 143568 java.util.concurrent.atomic.AtomicBoolean ([email protected]) ... 600: 296 7104 java.math.MathContext ([email protected]) 601: 221 7072 java.lang.invoke.BoundMethodHandle$Species_L ([email protected]) 602: 221 7072 java.lang.invoke.LambdaForm$NamedFunction ([email protected]) 603: 438 7008 clojure.core$distinct$step__6413 604: 291 6984 taoensso.nippy$read_kvs_into$fn__36561 605: 218 6976 sun.nio.fs.UnixPath ([email protected]) 606: 218 6976 taoensso.carmine.protocol.EnqueuedRequest 607: 173 6920 java.nio.channels.ClosedChannelException ([email protected]) 608: 431 6896 clojure.core.async.impl.ioc_macros$return_chan$fn__21752 609: 287 6888 javax.management.ImmutableDescriptor ([email protected]) ...
根据您可能从中解读的内容,它是一个API服务。根据实例数量,我认为exchange.api.restful.orders$fn__48874$*是糟糕的。(或者我可能是错的。我的同事建议Redis出了问题。)
exchange.api.restful.orders$fn__48874$*
但问题是:哪個函数/api是它?我该如何定位它?
尝试使用(fn some-name [] ...)而不是(fn [] ...)或。
(fn some-name [] ...)
(fn [] ...)
。