The largest positive int is 2^31 -- i.e., about 2 billion . That places a number of limits on Java objects and code, but really, these are not very significant. What possible use could you have for a 2GB object, anyway? Aside from an array, I can't even conceive of how you'd create one.
To answer your question: that limit affects a single object, not a chain of object references. Each object has its own limit..
Basically, the reference to B is included in the size of A. So, for each object that your object contains, your object will be 4 bytes (8 bytes for 64 bit JVMs) larger.
Note that there is no theoretical limit to the size of a Java object - the limit is determined by the particular implementation of the Java specification that you're using.