最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

netty-grpc一次DirectByteBuffer內(nèi)存泄露問題

 更新時(shí)間:2023年12月28日 08:47:04   作者:xihuanyuye  
這篇文章主要介紹了netty-grpc一次DirectByteBuffer內(nèi)存泄露問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

應(yīng)用場(chǎng)景

當(dāng)前應(yīng)用會(huì)采用grpc大量發(fā)送數(shù)據(jù),并且并發(fā)量并不固定

報(bào)錯(cuò)日志

2022-10-31 22:20:51.630  INFO 8 --- [ueue4-thread-20] c.t.s.d.p.ParquetNoBlockDataReaderWriter : groupCount:1,count:300000,end read end read
2022-10-31 22:20:51.630  INFO 8 --- [ueue4-thread-20] c.t.privpy.sdk.task.data.DataSender      : MTU4NzA4NzE3MDkxNTUzNjg5Nw noFragment read data plain://ds02/xgboost_vertical-20221031221952-df1650ce/bins_Bob_13_0_tree0_depth0.parquet;type=int32 finished!
Exception in thread "send1-thread-7" 2022-10-31 22:20:51.634  INFO 8 --- [Queue3-thread-1] c.t.p.s.t.d.n.NoFragmentDataSender       : MTU4NzA4NzE3MDkxNTUzNjg5Nw read plain data plain://ds02/xgboost_vertical-20221031221952-df1650ce/bins_Bob_13_0_tree0_depth0.parquet;type=int32 success!
Exception in thread "NoFragRec7-thread-8" 2022-10-31 22:20:51.634  INFO 8 --- [ptor2-thread-10] c.t.p.s.t.d.n.NoFragmentDataSender       : MTU4NzA4NzE3MDkxNTUzNjg5Nw start cipher for plain data transfer plain://ds02/xgboost_vertical-20221031221952-df1650ce/bins_Bob_13_0_tree0_depth0.parquet;type=int32
io.grpc.netty.shaded.io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 1256 byte(s) of direct memory (used: 68121888, max: 67108864)
        at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:754)
        at io.grpc.netty.shaded.io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:709)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledUnsafeNoCleanerDirectByteBuf.java:30)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledByteBufAllocator.java:186)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledDirectByteBuf.<init>(UnpooledDirectByteBuf.java:64)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledUnsafeDirectByteBuf.<init>(UnpooledUnsafeDirectByteBuf.java:41)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledUnsafeNoCleanerDirectByteBuf.java:25)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledByteBufAllocator.java:181)
        at io.grpc.netty.shaded.io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:91)
        at io.grpc.netty.shaded.io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:187)
        at io.grpc.netty.shaded.io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:178)
        at io.grpc.netty.shaded.io.netty.buffer.AbstractByteBufAllocator.buffer(AbstractByteBufAllocator.java:115)
        at io.grpc.netty.shaded.io.netty.handler.codec.base64.Base64.encode(Base64.java:108)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslUtils.toBase64(SslUtils.java:375)
        at io.grpc.netty.shaded.io.netty.handler.ssl.PemX509Certificate.append(PemX509Certificate.java:128)
        at io.grpc.netty.shaded.io.netty.handler.ssl.PemX509Certificate.toPEM(PemX509Certificate.java:86)
        at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslKeyMaterialProvider.validateSupported(OpenSslKeyMaterialProvider.java:78)
        at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslKeyMaterialProvider.validateKeyMaterialSupported(OpenSslKeyMaterialProvider.java:44)
        at io.grpc.netty.shaded.io.netty.handler.ssl.OpenSslClientContext.<init>(OpenSslClientContext.java:193)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslContext.newClientContextInternal(SslContext.java:827)
        at io.grpc.netty.shaded.io.netty.handler.ssl.SslContextBuilder.build(SslContextBuilder.java:576)
        at com.tsingj.privpy.sdk.client.grpc.ChannelPool.getESManagedChannel(ChannelPool.java:211)
        at com.tsingj.privpy.sdk.client.grpc.EsClient.getNewChannel(EsClient.java:60)
        at com.tsingj.privpy.sdk.client.grpc.EsClient.getResultData(EsClient.java:289)
        at com.tsingj.privpy.sdk.task.data.nofragment.NoFragmentDataReceiver.lambda$new$2(NoFragmentDataReceiver.java:205)
        at com.tsingj.privpy.sdk.task.core.QueueWithConsumer.lambda$new$0(QueueWithConsumer.java:41)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
Exception in thread "send1-thread-5" Exception in thread "send1-thread-1" io.grpc.netty.shaded.io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 4096 byte(s) of direct memory (used: 68121888, max: 67108864)

分析

計(jì)算了一下,大概是64M,正好是jvm啟動(dòng)時(shí)設(shè)置的參數(shù)大小。

java -server -Xms$XMS_VALUE -Xmx$XMX_VALUE -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseG1GC -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.rmi.port=8890 -Dcom.sun.management.jmxremote.port=8890 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -XX:+PrintGCDetails -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:G1MaxNewSizePercent=40 -XX:MaxDirectMemorySize=64M -XX:HeapDumpPath=/opt/gemini/javadsheapdump$DS_ID$DS_INSTANCE_ID -Xloggc:/opt/gemini/javadsgclog$DS_ID$DS_INSTANCE_ID -jar /ds/ds_run.jar --logging.level.root=$LOG_LEVEL

visualVm安裝插件

觀察到,其中buffer Pools穩(wěn)定在40M+,重啟后恢復(fù)。

當(dāng)前懷疑在發(fā)送突然超過DirectByteBuffer總大小時(shí),發(fā)生了Om,并且會(huì)導(dǎo)致后續(xù)一直無法回收內(nèi)存。

當(dāng)前策略

增大XX:MaxDirectMemorySize為512M,進(jìn)行觀察。

-XX:MaxDirectMemorySize=512M

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • 關(guān)于SpringGateway調(diào)用服務(wù) 接受不到參數(shù)問題

    關(guān)于SpringGateway調(diào)用服務(wù) 接受不到參數(shù)問題

    這篇文章主要介紹了關(guān)于SpringGateway調(diào)用服務(wù)接受不到參數(shù)問題,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-12-12
  • springMVC的生命周期詳解

    springMVC的生命周期詳解

    本篇文章主要介紹了springMVC的生命周期詳解,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-03-03
  • Java8的DateTimeFormatter與SimpleDateFormat的區(qū)別詳解

    Java8的DateTimeFormatter與SimpleDateFormat的區(qū)別詳解

    這篇文章主要介紹了Java8的DateTimeFormatter與SimpleDateFormat的區(qū)別詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-03-03
  • maven資源過濾打包后文件變大的處理方法

    maven資源過濾打包后文件變大的處理方法

    maven目前在web上面的使用方式很普遍,而打包的方式也存在很多方式,下面這篇文章主要給大家介紹了關(guān)于maven資源過濾打包后文件變大的處理方法,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2018-07-07
  • Java注解方式之防止重復(fù)請(qǐng)求

    Java注解方式之防止重復(fù)請(qǐng)求

    這篇文章主要介紹了關(guān)于Java注解方式防止重復(fù)請(qǐng)求,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-09-09
  • Java 并發(fā)編程創(chuàng)建線程的四種方式示例詳解

    Java 并發(fā)編程創(chuàng)建線程的四種方式示例詳解

    本文對(duì)比Java創(chuàng)建線程的四種方式:繼承Thread類(單繼承限制)、實(shí)現(xiàn)Runnable接口(靈活推薦)、實(shí)現(xiàn)Callable接口(支持返回值)、使用線程池(最佳實(shí)踐,資源管理高效),推薦優(yōu)先使用線程池提升系統(tǒng)穩(wěn)定性與資源利用率,感興趣的朋友一起看看吧
    2025-09-09
  • InputStreamReader和BufferedReader用法及實(shí)例講解

    InputStreamReader和BufferedReader用法及實(shí)例講解

    這篇文章主要介紹了InputStreamReader和BufferedReader用法及實(shí)例講解的相關(guān)資料,需要的朋友可以參考下
    2015-12-12
  • java中File轉(zhuǎn)為MultipartFile的四種實(shí)現(xiàn)方式

    java中File轉(zhuǎn)為MultipartFile的四種實(shí)現(xiàn)方式

    這篇文章主要介紹了java中File轉(zhuǎn)為MultipartFile的四種實(shí)現(xiàn)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-06-06
  • 一次因Java應(yīng)用造成CPU過高的排查實(shí)踐過程

    一次因Java應(yīng)用造成CPU過高的排查實(shí)踐過程

    一個(gè)應(yīng)用占用CPU很高,除了確實(shí)是計(jì)算密集型應(yīng)用之外,通常原因都是出現(xiàn)了死循環(huán)。下面這篇文章主要給大家介紹了一次因Java應(yīng)用造成CPU過高的排查實(shí)踐過程,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2018-11-11
  • java在文件尾部追加內(nèi)容的簡單實(shí)例

    java在文件尾部追加內(nèi)容的簡單實(shí)例

    下面小編就為大家?guī)硪黄猨ava在文件尾部追加內(nèi)容的簡單實(shí)例。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2016-12-12

最新評(píng)論

仙居县| 乌苏市| 禹州市| 临夏市| 汪清县| 奇台县| 封开县| 东丽区| 驻马店市| 凤翔县| 富阳市| 仪陇县| 秦安县| 大同县| 铅山县| 大余县| 浙江省| 隆尧县| 洪湖市| 公主岭市| 抚顺市| 辽宁省| 白城市| 通化县| 正定县| 若尔盖县| 襄樊市| 定襄县| 宜章县| 双江| 静海县| 汝城县| 林芝县| 阳曲县| 宜都市| 崇明县| 聂荣县| 白朗县| 理塘县| 永登县| 会宁县|