Number of instances of what? Generally, the objects that exist are the ones you create in your code, so you control the number through the code you write. Or are you talking about garbage collection?
you can control number of instance of an object via programming i.e. if you want by writing code in constructor to check the limit before creating any instance e.g. Singleton class which only has one instance. on the other hand Java does not provide any mechanism to control number of instance of any object neither to control garbage collection.