You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/12/27 03:36:20 UTC

[GitHub] [servicecomb-java-chassis] jiangqiushi opened a new issue #1499: 客户端开启access log后,memory leak

jiangqiushi opened a new issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499
 
 
   客户端开启access log后,压测一段时间频繁gc,通过heap dump分析是log4j的Marker占用的大量空间。
   ![image](https://user-images.githubusercontent.com/19721172/71499654-7881c080-289c-11ea-8f9c-bc5d9d3bcd12.png)
   
   本地debug发现,servicecomb每次请求会生成随机的maker,大量堆积。
   org.apache.servicecomb.swagger.invocation.context.InvocationContext
   ![image](https://user-images.githubusercontent.com/19721172/71499701-b1ba3080-289c-11ea-8640-67cb0bf279e4.png)
   
   项目maven依赖:
   [INFO] --- maven-dependency-plugin:2.10:tree (default-cli) 
   [INFO] +- com.huawei.wisecloud.dmq:dmq-mq:jar:1.3.7.201:compile
   [INFO] |  +- com.huawei.wisecloud.dmq:dmq-common:jar:1.3.7.201:compile
   [INFO] |  |  +- com.alibaba:dubbo:jar:2.5.10:compile
   [INFO] |  |  +- org.javassist:javassist:jar:3.18.1-GA:compile
   [INFO] |  |  \- com.huawei.wisecloud.apigateway:encryption-plugin2-NoSpring:jar:1.0.8:compile
   [INFO] |  +- com.alibaba:fastjson:jar:1.2.40:compile
   [INFO] |  +- com.huawei.wisecloud.dmq:kafka_2.10:jar:0.8.2.1132:compile
   [INFO] |  |  +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
   [INFO] |  |  +- org.scala-lang:scala-library:jar:2.10.4:compile
   [INFO] |  |  +- net.sf.jopt-simple:jopt-simple:jar:3.2:compile
   [INFO] |  |  \- com.101tec:zkclient:jar:0.8:compile
   [INFO] |  +- com.huawei.wisecloud.dmq:kafka-clients_2.10:jar:0.8.2.1133101:compile
   [INFO] |  \- com.huawei.wisecloud.dmq:kafka-clients:jar:0.10.1.1:compile
   [INFO] |     +- net.jpountz.lz4:lz4:jar:1.3.0:compile
   [INFO] |     \- org.xerial.snappy:snappy-java:jar:1.1.2.6:compile
   [INFO] +- org.apache.curator:curator-recipes:jar:4.0.0:compile
   [INFO] +- org.apache.curator:curator-client:jar:4.0.0:compile
   [INFO] |  +- org.apache.zookeeper:zookeeper:jar:3.5.4-beta:compile
   [INFO] |  |  +- commons-cli:commons-cli:jar:1.2:compile
   [INFO] |  |  +- log4j:log4j:jar:1.2.17:compile
   [INFO] |  |  +- org.apache.yetus:audience-annotations:jar:0.5.0:compile
   [INFO] |  |  \- io.netty:netty:jar:3.10.6.Final:compile
   [INFO] |  +- com.google.guava:guava:jar:25.1-jre:compile
   [INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.1:compile
   [INFO] |  |  +- org.checkerframework:checker-qual:jar:2.0.0:compile
   [INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.1.3:compile
   [INFO] |  |  +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
   [INFO] |  |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
   [INFO] |  \- org.slf4j:slf4j-api:jar:1.7.26:compile
   [INFO] +- org.apache.curator:curator-framework:jar:4.0.0:compile
   [INFO] +- com.huawei.wisecloud:cloudsoa-lbs-sdk:jar:1.0.2.300(SP1):compile
   [INFO] |  +- com.huawei.wisecloud.cloudsoa-lbs-sdk:commons-io:jar:2.5-PDM:compile
   [INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
   [INFO] |  \- org.apache.httpcomponents:httpcore:jar:4.4.10:compile
   [INFO] +- com.huawei.smurf.cloud.foundation:cloud-foundation-encryption:jar:1.0.9.5(ST2):compile
   [INFO] |  \- com.huawei.smurf.cloud.foundation:cloud-foundation-common:jar:1.0.9.5(ST2):compile
   [INFO] |     \- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.0:compile
   [INFO] |        +- org.apache.logging.log4j:log4j-api:jar:2.11.0:compile
   [INFO] |        \- org.apache.logging.log4j:log4j-core:jar:2.11.0:runtime
   [INFO] +- com.huawei.smurf.cloud.foundation:cloud-foundation-web:jar:1.0.9.5(ST2):compile
   [INFO] +- commons-beanutils:commons-beanutils:jar:1.9.4:compile
   [INFO] |  +- commons-logging:commons-logging:jar:1.2:compile
   [INFO] |  \- commons-collections:commons-collections:jar:3.2.2:compile
   [INFO] +- org.apache.httpcomponents:httpmime:jar:4.5.5:compile
   [INFO] +- org.apache.servicecomb:spring-boot-starter-transport:jar:1.1.0.B046:compile
   [INFO] |  +- org.apache.servicecomb:spring-boot-starter-servicecomb:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.33:compile
   [INFO] |  |  \- org.springframework.boot:spring-boot-starter:jar:1.5.12.RELEASE:compile
   [INFO] |  |     +- org.springframework.boot:spring-boot:jar:1.5.12.RELEASE:compile
   [INFO] |  |     +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.12.RELEASE:compile
   [INFO] |  |     +- org.springframework:spring-core:jar:4.3.20.RELEASE:compile
   [INFO] |  |     \- org.yaml:snakeyaml:jar:1.16:compile
   [INFO] |  +- org.apache.servicecomb:transport-rest-servlet:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.springframework:spring-webmvc:jar:4.3.20.RELEASE:compile
   [INFO] |  |  |  +- org.springframework:spring-aop:jar:4.3.20.RELEASE:compile
   [INFO] |  |  |  +- org.springframework:spring-beans:jar:4.3.20.RELEASE:compile
   [INFO] |  |  |  +- org.springframework:spring-context:jar:4.3.20.RELEASE:compile
   [INFO] |  |  |  +- org.springframework:spring-expression:jar:4.3.20.RELEASE:compile
   [INFO] |  |  |  \- org.springframework:spring-web:jar:4.3.20.RELEASE:compile
   [INFO] |  |  \- org.apache.servicecomb:transport-rest-client:jar:1.1.0.B046:compile
   [INFO] |  |     \- org.apache.servicecomb:common-rest:jar:1.1.0.B046:compile
   [INFO] |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
   [INFO] |  +- javax.inject:javax.inject:jar:1:compile
   [INFO] |  \- org.springframework:spring-aspects:jar:4.3.20.RELEASE:compile
   [INFO] |     \- org.aspectj:aspectjweaver:jar:1.8.8:compile
   [INFO] +- com.huawei.paas.cse:cse-solution-service-engine:jar:2.3.63:compile
   [INFO] |  +- com.huawei.paas.cse:foundation-auth:jar:2.3.63:compile
   [INFO] |  |  +- org.apache.servicecomb:foundation-common:jar:1.1.0.B046:compile
   [INFO] |  |  |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.9.8:compile
   [INFO] |  |  |  |  +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.8.11:compile
   [INFO] |  |  |  |  +- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
   [INFO] |  |  |  |  \- com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
   [INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.8:compile
   [INFO] |  |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.8:compile
   [INFO] |  |  |  \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
   [INFO] |  |  +- org.apache.servicecomb:foundation-ssl:jar:1.1.0.B046:compile
   [INFO] |  |  |  +- commons-configuration:commons-configuration:jar:1.10:compile
   [INFO] |  |  |  \- io.netty:netty-tcnative-boringssl-static:jar:2.0.14.Final:compile
   [INFO] |  |  \- org.apache.servicecomb:foundation-config:jar:1.1.0.B046:compile
   [INFO] |  |     +- io.netty:netty-codec:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-codec-http:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-codec-http2:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-common:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-handler:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-buffer:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-codec-socks:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-handler-proxy:jar:4.1.28.Final:compile
   [INFO] |  |     +- io.netty:netty-resolver:jar:4.1.28.Final:compile
   [INFO] |  |     \- io.netty:netty-transport:jar:4.1.28.Final:compile
   [INFO] |  +- org.apache.servicecomb:config-cc:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.apache.servicecomb:deployment:jar:1.1.0.B046:compile
   [INFO] |  |  \- org.apache.servicecomb:foundation-vertx:jar:1.1.0.B046:compile
   [INFO] |  |     +- io.vertx:vertx-core:jar:3.6.2:compile
   [INFO] |  |     |  \- io.netty:netty-resolver-dns:jar:4.1.28.Final:compile
   [INFO] |  |     |     \- io.netty:netty-codec-dns:jar:4.1.28.Final:compile
   [INFO] |  |     \- io.vertx:vertx-web:jar:3.6.2:compile
   [INFO] |  |        +- io.vertx:vertx-web-common:jar:3.6.2:compile
   [INFO] |  |        +- io.vertx:vertx-auth-common:jar:3.6.2:compile
   [INFO] |  |        \- io.vertx:vertx-bridge-common:jar:3.6.2:compile
   [INFO] |  +- org.apache.servicecomb:transport-highway:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.apache.servicecomb:java-chassis-core:jar:1.1.0.B046:compile
   [INFO] |  |  |  \- io.zipkin.brave:brave:jar:5.6.0:compile
   [INFO] |  |  |     +- io.zipkin.zipkin2:zipkin:jar:2.9.3:compile
   [INFO] |  |  |     \- io.zipkin.reporter2:zipkin-reporter:jar:2.5.0:compile
   [INFO] |  |  +- org.apache.servicecomb:common-protobuf:jar:1.1.0.B046:compile
   [INFO] |  |  |  +- org.apache.servicecomb:common-javassist:jar:1.1.0.B046:compile
   [INFO] |  |  |  \- org.apache.servicecomb:foundation-protobuf:jar:1.1.0.B046:compile
   [INFO] |  |  |     +- io.protostuff:protostuff-parser:jar:2.2.25:compile
   [INFO] |  |  |     |  +- org.antlr:antlr4:jar:4.7:compile
   [INFO] |  |  |     |  |  +- org.antlr:antlr4-runtime:jar:4.7:compile
   [INFO] |  |  |     |  |  +- org.antlr:antlr-runtime:jar:3.5.2:compile
   [INFO] |  |  |     |  |  +- org.antlr:ST4:jar:4.0.8:compile
   [INFO] |  |  |     |  |  +- org.abego.treelayout:org.abego.treelayout.core:jar:1.0.3:compile
   [INFO] |  |  |     |  |  +- org.glassfish:javax.json:jar:1.0.4:compile
   [INFO] |  |  |     |  |  \- com.ibm.icu:icu4j:jar:58.2:compile
   [INFO] |  |  |     |  +- com.google.inject.extensions:guice-multibindings:jar:4.1.0:compile
   [INFO] |  |  |     |  \- com.google.inject.extensions:guice-assistedinject:jar:4.1.0:compile
   [INFO] |  |  |     +- io.protostuff:protostuff-runtime:jar:1.5.2:compile
   [INFO] |  |  |     |  +- io.protostuff:protostuff-api:jar:1.5.2:compile
   [INFO] |  |  |     |  \- io.protostuff:protostuff-collectionschema:jar:1.5.2:compile
   [INFO] |  |  |     +- io.protostuff:protostuff-core:jar:1.5.2:compile
   [INFO] |  |  |     \- com.google.protobuf:protobuf-java:jar:3.5.1:compile
   [INFO] |  |  +- org.apache.servicecomb:transport-common:jar:1.1.0.B046:compile
   [INFO] |  |  \- org.apache.servicecomb:foundation-metrics:jar:1.1.0.B046:compile
   [INFO] |  |     \- com.netflix.spectator:spectator-reg-servo:jar:0.71.0:compile
   [INFO] |  |        \- com.netflix.spectator:spectator-api:jar:0.71.0:compile
   [INFO] |  +- org.apache.servicecomb:transport-rest-vertx:jar:1.1.0.B046:compile
   [INFO] |  +- org.apache.servicecomb:provider-springmvc:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.apache.servicecomb:provider-rest-common:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.apache.servicecomb:swagger-invocation-springmvc:jar:1.1.0.B046:compile
   [INFO] |  |  |  \- com.google.inject:guice:jar:4.1.0:compile
   [INFO] |  |  |     \- aopalliance:aopalliance:jar:1.0:compile
   [INFO] |  |  \- org.apache.servicecomb:swagger-generator-springmvc:jar:1.1.0.B046:compile
   [INFO] |  |     \- org.apache.servicecomb:swagger-generator-core:jar:1.1.0.B046:compile
   [INFO] |  |        \- io.swagger:swagger-core:jar:1.5.12:compile
   [INFO] |  |           +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.8:compile
   [INFO] |  |           \- io.swagger:swagger-models:jar:1.5.12:compile
   [INFO] |  |              \- io.swagger:swagger-annotations:jar:1.5.12:compile
   [INFO] |  +- org.apache.servicecomb:provider-pojo:jar:1.1.0.B046:compile
   [INFO] |  +- org.apache.servicecomb:provider-jaxrs:jar:1.1.0.B046:compile
   [INFO] |  |  +- org.apache.servicecomb:swagger-invocation-jaxrs:jar:1.1.0.B046:compile
   [INFO] |  |  \- org.apache.servicecomb:swagger-generator-jaxrs:jar:1.1.0.B046:compile
   [INFO] |  +- org.apache.servicecomb:handler-bizkeeper:jar:1.1.0.B046:compile
   [INFO] |  |  \- com.netflix.hystrix:hystrix-core:jar:1.5.12:compile
   [INFO] |  |     \- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
   [INFO] |  +- org.apache.servicecomb:handler-fault-injection:jar:1.1.0.B046:compile
   [INFO] |  +- org.apache.servicecomb:handler-flowcontrol-qps:jar:1.1.0.B046:compile
   [INFO] |  +- org.apache.servicecomb:handler-loadbalance:jar:1.1.0.B046:compile
   [INFO] |  |  +- com.netflix.ribbon:ribbon:jar:2.2.2:compile
   [INFO] |  |  |  +- com.netflix.ribbon:ribbon-transport:jar:2.2.2:runtime
   [INFO] |  |  |  |  +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
   [INFO] |  |  |  |  \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
   [INFO] |  |  |  \- io.reactivex:rxnetty:jar:0.4.9:runtime
   [INFO] |  |  +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.2:compile
   [INFO] |  |  |  +- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
   [INFO] |  |  |  +- com.netflix.servo:servo-core:jar:0.10.1:compile
   [INFO] |  |  |  |  \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
   [INFO] |  |  |  \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime
   [INFO] |  |  +- com.netflix.ribbon:ribbon-core:jar:2.2.2:compile
   [INFO] |  |  +- com.netflix.archaius:archaius-core:jar:0.7.3:compile
   [INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.9.8:compile
   [INFO] |  |  +- io.reactivex:rxjava:jar:1.1.6:compile
   [INFO] |  |  \- commons-lang:commons-lang:jar:2.6:compile
   [INFO] |  +- org.apache.servicecomb:handler-publickey-auth:jar:1.1.0.B046:compile
   [INFO] |  +- com.huawei.paas.cse:cse-handler-performance-stats:jar:2.3.63:compile
   [INFO] |  +- com.huawei.paas.cse:cse-handler-cloud-extension:jar:2.3.63:compile
   [INFO] |  |  \- org.apache.servicecomb:service-registry:jar:1.1.0.B046:compile
   [INFO] |  \- org.apache.servicecomb:swagger-invocation-validator:jar:1.1.0.B046:compile
   [INFO] |     +- org.apache.servicecomb:swagger-invocation-core:jar:1.1.0.B046:compile
   [INFO] |     +- org.hibernate.validator:hibernate-validator:jar:6.0.2.Final:compile
   [INFO] |     |  +- javax.validation:validation-api:jar:2.0.0.Final:compile
   [INFO] |     |  +- org.jboss.logging:jboss-logging:jar:3.2.1.Final:compile
   [INFO] |     |  \- com.fasterxml:classmate:jar:1.3.4:compile
   [INFO] |     \- org.glassfish:javax.el:jar:3.0.0:compile
   [INFO] +- com.huawei.wisecloud.kms:cloudsoa-security:jar:1.1.6:compile
   [INFO] |  +- org.bouncycastle:bcprov-jdk15on:jar:1.60:compile
   [INFO] |  +- commons-codec:commons-codec:jar:1.10:compile
   [INFO] |  +- org.apache.commons:commons-lang3:jar:3.6:compile
   [INFO] |  \- commons-io:commons-io:jar:2.4:compile
   [INFO] +- org.projectlombok:lombok:jar:1.18.6:provided
   [INFO] \- com.lmax:disruptor:jar:3.4.2:compile
   [INFO] ------------------------------------------------------------------------
   
   请帮忙看下一下,多谢

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569380941
 
 
   > 是不是只有开启access log才会memory leak?
   
   应该是无论是否开启access log都会触发这个问题的

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569179720
 
 
   你们使用的日志打印框架是log4j2吧?
   log4j2会把打印日志时传入的marker全部放在一个map中缓存起来,随着调用的总次数增加,marker对象越来越多,导致内存泄漏。
   建议升级到最新版本的Java-Chassis以修复这个问题。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] WillemJiang commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
WillemJiang commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569646677
 
 
   @yhs0092 看样子是需要在log4j 设置中做一些文章,建议给出相关配置示例,同时更新文档。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569650054
 
 
   修复逻辑是在`org.apache.servicecomb.core.SCBEngine#SCBEngine`构造方法中触发,自动在Java-Chassis启动流程中执行的,这个对于用户而言是无感知的。用户只需要将Java-Chassis升级至1.2.1或以上的版本就可以修复这个问题了。
   相关的issue是 [SCB-1266](https://issues.apache.org/jira/browse/SCB-1266)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] WillemJiang commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
WillemJiang commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569381353
 
 
   @yhs0092 如何修复呢?
   我觉得log4j2不应该出这样的低级错误啊,是不是我们的代码没有写好?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] jiangqiushi closed issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
jiangqiushi closed issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569623583
 
 
   我们用marker输出invocation的id,便于追踪单条请求的日志,由于要输出到日志的固定列以便于各种日志采集分析工具使用,最合适的机制就是marker。
   但是log4j2应该是没有原生支持marker,所以把它做了一个包装。而且它会把所有包装过的marker保存在一个map中(`org.apache.logging.slf4j.Log4jMarkerFactory#addMarkerIfAbsent`),这样就导致内存泄漏了。
   
   修复方案在`org.apache.servicecomb.foundation.common.log.LogMarkerLeakFixUtils#fix`中,Java-Chassis用一个自定义的`Log4jMarkerFactory`替换了log4j2的`Log4jMarkerFactory`,不缓存marker。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] jiangqiushi commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
jiangqiushi commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-573977344
 
 
   多谢,升级版本到1.2.0.B006问题已经解决。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] jiangqiushi commented on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
jiangqiushi commented on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569195505
 
 
   > 你们使用的日志打印框架是log4j2吧?
   > log4j2会把打印日志时传入的marker全部放在一个map中缓存起来,随着调用的总次数增加,marker对象越来越多,导致内存泄漏。
   > 建议升级到最新版本的Java-Chassis以修复这个问题。
   
   你们在哪个版本修复的?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-java-chassis] jiangqiushi edited a comment on issue #1499: 客户端开启access log后,memory leak

Posted by GitBox <gi...@apache.org>.
jiangqiushi edited a comment on issue #1499: 客户端开启access log后,memory leak
URL: https://github.com/apache/servicecomb-java-chassis/issues/1499#issuecomment-569195505
 
 
   > 你们使用的日志打印框架是log4j2吧?
   > log4j2会把打印日志时传入的marker全部放在一个map中缓存起来,随着调用的总次数增加,marker对象越来越多,导致内存泄漏。
   > 建议升级到最新版本的Java-Chassis以修复这个问题。
   
   你们在哪个版本修复的?是不是只有开启access log才会memory leak?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services