Where are the temporary output layers from QGIS processing algorithms stored?

As @ndawson correctly commented:

They weren't memory layers, they were just shapefiles stored in a temporary location (and subject to all the limitations present in the shapefile format!)

The final note is that the name "memory layer" was improperly used.


The layer with the URL starting 'polygon:' is a memory layer (or 'scratch' layer). You can create one yourself using Add layer > New temporary scratch layer. As it's in memory, it's not written off to disk (unless you decide to do this manually using save as..) and will vanish once you close QGIS.

According to the docs (emphasis mine)

Memory provider is intended to be used mainly by plugin or 3rd party app developers. It does not store data on disk, allowing developers to use it as a fast backend for some temporary layers.

Recent versions of QGIS' Geoalgorithms default to writing to "new temporary layer" if you don't specify a filename in the pull-down menu (the ... button) so you can always save the intermediate steps in your process if you want

GRASS and SAGA don't understand memory layers, as far as I know, so they continue to write to /tmp

You can access memory layers like any other layer, query against them as virtual layers etc.