If you're using Photoshop in 32bits ,I think Save for Web cannot exceed 2GB.You can try with Photoshop CC 64bits in this case or decrease your resolution for example .
If it cannot create a temp file, which indeed is tied to the limitations for 32bit apps and in Save for Web cannot exceed 2GB,
That's what it's telling you, and this has absolutely nothing to do with your system swap file.
A possible solution may be to manually flatten the file before exporting or it might also help to clean up the Drive you are using as Scratch disk.
In Addition to this:
Hope this helps