The difference is associated with different memory management schemes. Objective-C and Swift are reference counting, while Java on Dalvik and ART uses a garbage collector for marking and markup. This means that in obj-c and swift objects, objects are freed as soon as the last reference to them is released (or when the autostart pool merges), while in Java objects they can exist for as long as necessary if the application is not under memory pressure As a result, Java objects cannot reliably copy automatic memory management to clear a resource without memory, but sometimes Objective-C and Swift objects may exist.
Thomas goyne
source share