Paro de otimizar a troca de memória conforme instruído por cas , focado em outras coisas. Por favor, observe o comentário do cas
Finally, swapping is something to be avoided if at all possible. if you can upgrade your system's RAM, then do so. If you can offload the RAM-hungry task to another machine, then do so. Swap is always a last resort, because it's slow. If you need to run large matlab etc jobs frequently then no amount of swap space will relieve the frustration and tedium of waiting for it to finish (or make your machine interactively usable while it's thrashing data in and out of swap)...which is why i suggested building a linux box you can connect to via ssh to run large memory-hungry jobs on.