has File field. This field is used for caching canonical path.
Code model uses canonical paths for the same files too.
So the proposal is to
1) use string instead of File
2) share this strings between modules
(There is such string sharing machanizm in apt module; it should be extracted into a separate module)
I don't mean this will save a lot - probably about 1-2% of total memory consumption.
But, as soon as we start makeproject memory optimizations (I hope this will occur some day), this 1-2% will be a rather
low hanging fruit.
Not sure what to fix. It make sense to cache File in Item for internal purposes and File is available with getFile() in the NativeFileItem interface. Why can't you just use NativeFileItem.getFile() in your code?