But I'm pretty sure virtual memory is used. For example, after running firefox for a long time, it takes me a while to close it as some of its data is swapped to the disk and somehow firefox needs to access it.
You are confusing virtual memory with paging and swapping. Virtual memory is an essential part of the operating system. It gives the OS the ability to use any random 4K chunks (pages) of memory with any program. That is to say, VM means the OS can grab a bunch of available pages and create a range of virtual addresses that a program can use. Before VM, it was extremely difficult to manage physical memory.
Paging and swapping are a way of pretending you have more physical memory than is physically installed in the system. Before virtual memory there was just swapping of an entire program out of memory. With virtual memory it is possible to just page out parts of a program.
It is the paging and swapping that is annoying you, not virtual memory. An operating system without virtual memory is called DOS 🙂
Also I have a problem that my machine cannot be reboot and shutdown after running one or two weeks. I think it has something to do with virtual memory. So I want to try disabling virtual memory.
Neither virtual memory nor paging would affect your ability to shutdown or reboot.
You have something else going on.
Have you by any chance installed some intrusive 3rd party software, such as an anti-virus utility?