How to locate the code location of memory problems

problem description

look at the server system resources and find that 80% of the memory has been eaten by a process, and then navigated to a PHP process.

so how can I continue to locate and find the code location, or the file?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a77c-2c20b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a77c-2c20b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?