Vayasaana Geek
Vayasaana Geek

Reputation: 11

why does Eclipse memory analyser not show InetSocketAddress string values?

I am analysing a heap dump using eclipse memory analyzer tool. I am trying to list the SocktChannels and their remote addresses. I am unable to see their IP Addresses and the port. I use the following OQL :

SELECT x.toString() FROM sun.nio.ch.SocketChannelImpl x

The same string is available when I live debug the application in eclipse - java.nio.channels.SocketChannel[connected local=/127.0.0.1:3033 remote=/127.0.0.1:54379] Is there a way to get this information?

memory analyser screenshot

Upvotes: 1

Views: 362

Answers (1)

Piotr Praszmo
Piotr Praszmo

Reputation: 18340

Memory analyzer doesn't support toString methods for all types - only for basic ones. You have to query the exact fields. For example:

SELECT x.remoteAddress.holder.addr.holder.hostName.toString() + ":" + x.remoteAddress.holder.port FROM sun.nio.ch.SocketChannelImpl x 

Upvotes: 0

Related Questions