Open spauldhaliwal opened 3 months ago
This was an incorrect assessment on my part. The confusion comes from devtools reporting ~40 mb increase in allocated ram, however, this is a bug in devtools. Actually RSS increases are minimal.
I will let this open because it's still it's a good option to have Maybe the app use few images so there is no need for spawning an isolate
The is simple to implement hoverer I couldn't find time lately to do anything
Depending on the particulars of an app, using isolates can greatly increase memory usage. From my understanding, since all global properties are copied when spawning an isolate, there's the possibility of essentially doubling initial ram usage when the isolate is used. In my app in particular, the memory used by
_imagesHelperIsolate
matches that of the main isolate, which means ram usage is doubled.For most apps this probably isn't an issue, but still I believe a flag in DisposableImages.init allowing users to disable isolate usage would be advisable.
Edit: Btw, in devtools you can now view ram usage of other isolates by clicking on "main #1" on the bottom blue bar of the devtools page. I believe this was a recent addition to devtools (or at least I wasn't aware of it until last year)