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

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

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

應(yīng)用場景

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

報錯日志

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)

分析

計算了一下,大概是64M,正好是jvm啟動時設(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總大小時,發(fā)生了Om,并且會導(dǎo)致后續(xù)一直無法回收內(nèi)存。

當(dāng)前策略

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

-XX:MaxDirectMemorySize=512M

總結(jié)

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

相關(guān)文章

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

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

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

    springMVC的生命周期詳解

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

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

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

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

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

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

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

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

    本文對比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)方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-06-06
  • 一次因Java應(yīng)用造成CPU過高的排查實(shí)踐過程

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

    一個應(yīng)用占用CPU很高,除了確實(shí)是計算密集型應(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í)例。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2016-12-12

最新評論

南雄市| 那坡县| 肥城市| 闻喜县| 雅安市| 蒙山县| 韩城市| 永康市| 华宁县| 周宁县| 永川市| 申扎县| 赤城县| 潢川县| 巢湖市| 新龙县| 阳东县| 定西市| 泰顺县| 外汇| 云和县| 察雅县| 乌苏市| 友谊县| 诸暨市| 鸡西市| 积石山| 北安市| 永年县| 道真| 昔阳县| 措勤县| 遂川县| 韶山市| 祁阳县| 汝南县| 横峰县| 连江县| 左权县| 绵阳市| 阳原县|