1

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

Anna Nevison
  • 2,709
  • 6
  • 21

1 Answers1

0

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 
Piotr Praszmo
  • 17,928
  • 1
  • 57
  • 65