小编jor*_*o10的帖子

netty PoolChunk 中累积的内存

嗨,我试图理解为什么我的应用程序内存消耗如此之大,所以我使用 VisualJVM 下载了一个堆转储,然后使用 Eclipse Mat 对其进行了分析。它发现了以下问题:

One instance of "io.netty.buffer.PoolChunk" loaded by "jdk.internal.loader.ClassLoaders$AppClassLoader @ 0x7f04ba5b0" occupies 16,793,832 (32.78 %) bytes. The memory is accumulated in one instance of "byte[]" loaded by "<system class loader>".

有人可以给我一些关于如何解决这个问题的建议吗?要查找和搜索哪些数据?

我的第一次尝试是设置 -Dio.netty.allocator.type=unpooled 参数,这消除了与字节相关的问题嫌疑,但引入了与类加载器相关的其他2个问题。

问候在此输入图像描述

memory-leaks netty

9
推荐指数
2
解决办法
1万
查看次数

Android recycler查看divideritem 4.4兼容性

我在回收器视图中渲染divider项目时只有for android 4.4,它的工作正常在android 5.0中有这个异常

java.lang.NullPointerException
        at android.view.GLES20Canvas.setupModifiers(GLES20Canvas.java:1439)
        at android.view.GLES20Canvas.drawLines(GLES20Canvas.java:1019)
        at android.view.GLES20Canvas.drawLine(GLES20Canvas.java:1009)
        at android.graphics.drawable.GradientDrawable.draw(GradientDrawable.java:538)
        at com.sistac.informecampos.fragments.DividerItemDecoration.onDrawOver(DividerItemDecoration.java:35)
        at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:2444)
        at android.view.View.getDisplayList(View.java:13362)
        at android.view.View.getDisplayList(View.java:13404)
        at android.view.View.draw(View.java:14182)
        at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
        at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1040)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
        at android.view.View.getDisplayList(View.java:13357)
        at android.view.View.getDisplayList(View.java:13404)
        at android.view.View.draw(View.java:14182)
        at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
        at android.view.View.getDisplayList(View.java:13357)
        at android.view.View.getDisplayList(View.java:13404)
        at android.view.View.draw(View.java:14182)
        at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
        at android.view.View.getDisplayList(View.java:13357)
        at android.view.View.getDisplayList(View.java:13404)
        at android.view.View.draw(View.java:14182)
        at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
        at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1229)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
        at android.view.View.getDisplayList(View.java:13357)
        at android.view.View.getDisplayList(View.java:13404)
        at android.view.View.draw(View.java:14182)
        at android.view.ViewGroup.drawChild(ViewGroup.java:3103)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2940)
        at android.view.View.draw(View.java:14468)
        at android.widget.FrameLayout.draw(FrameLayout.java:472)
        at android.view.View.getDisplayList(View.java:13362)
        at android.view.View.getDisplayList(View.java:13404)
        at …
Run Code Online (Sandbox Code Playgroud)

android android-recyclerview

3
推荐指数
1
解决办法
1087
查看次数

记录项目反应堆的生产

我有一个与使用反应堆项目登录 Spring Web-Flux 生产相关的问题。我在暂存环境中有以下代码,它记录了与信号相关的大量信息,这当然对于调试目的非常有用。

Mono.zip(localChargeIdMono, userIdMono, merchantMono, totalAmountMono, requestIdMono)
                .map(this::toNewTransaction)
                        .log("TransactionRepository.save")
                        .then(chargeMono)
                        .map(chargeResult -> Tuples.of(transaction, chargeResult))
                        .map(this::toNewTransactionUpdatedWithChargeResult))
                .flatMap(tuple -> Mono.zip(
                        transactionRepository.save(tuple.getT1()),
                        paymentUpdateRepository.save(tuple.getT2())))
                .log("t.p.save")
                .map(Tuple2::getT1)
                .map(this::toChargeTransactionDto);
Run Code Online (Sandbox Code Playgroud)

但我想知道这是否是登录生产的正确方法,或者我应该使用 doOn* 方法仅记录相关数据,例如副作用函数输入/输出参数。

Mono.zip(localChargeIdMono, userIdMono, merchantMono, totalAmountMono, requestIdMono)
                    .map(this::toNewTransaction)
                            .donOnNext(e -> log.info(e))
                            .then(chargeMono)
                            .map(chargeResult -> Tuples.of(transaction, chargeResult))
                            .map(this::toNewTransactionUpdatedWithChargeResult))
                    .flatMap(tuple -> Mono.zip(
                            transactionRepository.save(tuple.getT1()),
                            paymentUpdateRepository.save(tuple.getT2())))
                     .donOnNext(e -> log.info(e))
                    .map(Tuple2::getT1)
                    .map(this::toChargeTransactionDto);
Run Code Online (Sandbox Code Playgroud)

我正在寻找一个与产品上的项目反应器工作经验更相关的答案,因为这是我第一次。

谢谢

logging project-reactor

3
推荐指数
1
解决办法
2742
查看次数