While researching on this question: Java: garbage collection for RMI target object? I saw that a full GC is triggered the first time I make this call:
UnicastRemoteObject.exportObject(new Remote(){}, 0);
I ran a very simple program containing the call above, with -verbose:gc set, and consistently saw that a full GC was triggered, e.g. [Full GC 1070K->184K(47552K), 0.0070096 secs]
I ran it through Eclipse, in command line, and on virtual and physical machines. I'm using Sun jdk and hotspot 1.6.
Has anybody observed similar behavior? What can be its cause?