It may or may be related to some malware.
First, I recommend that you restart your mac, and see if the problem recurs. It could be just a one-off thing.
It could be that you have some application that is using a lot of memory. Or maybe you have a huge number or tabs open simultaneously. Each will use memory, sometimes a lot of memory.
We are not looking over your shoulder, so we need you to provide information, so that we can ascertain what may be the cause of the problem. To that effect, please run Etrecheck and post its full report here.
Use the "additional text" button and paste the report into the text box. The report does not include any private information, as you can check for yourself before posting anything. It will tell us about what software modifications are installed that could be having an impact.