Wikibase Lua methods for working with item properties like mw.wikibase.getAllStatements() and mw.wikibase.getBestStatements() should not load an entire item into the Lua memory.
The difference between these functions and the methods of the mw.wikibase.entity object is that here we do not initially get all element statements. Therefore, instead of working in the same way as the methods of the mw.wikibase.entity object, they should only load into memory those data that were requested.
A real example: if you want to display a list of country names with flags, then approximately 25 elements are enough to occupy all 50 MB of memory in Lua.