- Home /
Memory leak when running Process()
Reposted from a different area: I am running a program in Unity to test out a gaming controller I am developing. I have written a program in C (we'll call it "USBdata") to take incoming data from the controller on a USB port, and then send that data via TCP socket to a server on the same computer. Unity is currently running that server and getting data from the program. When I play the program in Unity, it pauses until I start up USBdata to access the USB port. Then it connects to the socket and stream data continually like it's supposed to. Memory allocation/ usage is "normal". Unity uses around 160MB, and USBdata uses around 0.9MB. However, when I try to open USBdata in void Start() using Prcess() to save myself the effort of opening it manually every time, something really weird happens: the memory usage of USBdata (according to task manager) increases at a rate of around 100MB/ second. Apparently it's not Unity, but when I open them seperately, Unity runs fine and neither uses a ton of memory. I have 8GB of memory on my computer. As a result, I am having problems. Why would opening the program in Start() cause this to happen, but not when I open it manually?