Skip to content

the java.net.InetSocketAddress .<init> use 100% cpu . #2

@jiatongwu

Description

@jiatongwu

image

you muse change the code

from
// InetSocketAddress dstAddress = new InetSocketAddress(msg.dstAddr(), msg.dstPort());
// AttributeKey dstAddressKey = AttributeKey.valueOf(DST_ADDRESS);
// clientChannelContext.channel().attr(dstAddressKey).setIfAbsent(dstAddress);
to
AttributeKey dstHostKey = AttributeKey.valueOf(DST_HOST);
clientChannelContext.channel().attr(dstHostKey).setIfAbsent(dstHost);
AttributeKey dstPortKey = AttributeKey.valueOf(DST_PORT);
clientChannelContext.channel().attr(dstPortKey).setIfAbsent(dstPort);

because the java.net.InetSocketAddress . use 100% cpu .
yout can use jprofile to view the cpu load on which method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions