I wanted to do some memory sampling on my VM that's running on the Linux box that doesn't have an XWindows running. I have tried to do it remotely but apparently, JVisualVM does not support remote memory sampling.
It also depends on the type of sampling you are trying to do. The jmap consoles the tool and allows some kind of memory dumping etc.