Class A
doesn’t know about its derived classes (they might be physically completely separate, in other compilation units, loaded later at run time). Even if it did, there’s no sense in allocating space for all its derived classes – because it is not its derived classes.
Just like parents don’t go to school for their children, a class does not act in its derived classes’ stead.
does the vtable created fits the size of both ints a and b or does the space allocated fits only an object of type A?
These members do not go into the vtable anyway. As for members which do go into the vtable (= virtual functions), the above applies: a base class’ vtable is only big enough for the virtual functions it declares, and no others.