Simulate more RAM with SQL Server
The DBCC WHATIF command (also see http://devondba.blogspot.co.uk/2014/03/dbcc-optimizerwhatif.html) can be used to simulate a certain hardware configuration for the current session:

dbcc OPTIMIZER_WHATIF ({property/cost_number | property_name} [, {integer_value | string_value} ])


The MemoryMBs property must be set to some value.

After that it appears to be necessary to recompile the query in question (for example using DBCC FREEPROCCACHE on a dev box, or using OPTION (RECOMPILE) if that hint is acceptable for later production use).

It is easy to tell that the WHATIF value "took" by the fact that it influences the &lt;OptimizerHardwareDependentProperties&gt; values in the XML execution plan.