One common dilemma for performance testers is deciding whether to run Vusers as processes or threads. To make an informed choice, it’s important to first understand the distinction between a process and a thread. 1. Process : A process is an instance of a computer program being executed, with its own dedicated virtual address space. Multiple processes can run simultaneously, but each process operates independently and does not share its memory address space with others. Example : If you open Notepad, you’ll see a process named notepad.exe in the task manager under the Processes tab. Opening another instance of Notepad will create a second notepad.exe process. Each process has its own memory space, and communication between processes happens through mechanisms like inter-process communication (IPC). 2. Thread : A thread exists within a process and shares the process’s memory address space with other threads. Multiple threads within the same process can access shared memory, and when o
Memory leaks can arise in various ways depending on how they are introduced, but they all exhibit a similar behavior, which ultimately makes them a performance issue. To demonstrate, consider a simplified example involving a process. Imagine you're testing a function on a web server, where the process executes a computation and returns a result. During this, it requests a chunk of memory. However, due to a bug, the process mistakenly requests the same chunk twice. When the result is returned, it only releases one chunk, leaving the other unreleased. Each time this function is called, the same issue occurs, and over time, the process consumes more of the host machine’s available memory, leading to a "memory leak." As this continues, the host system is impacted because the memory that should have been freed is never returned, causing the process to consume excessive resources until it either crashes or is forcefully terminated. In my experience, these types of memory leaks