Run-time memory management

Main article: Stack-based memory allocation and stack machine. A number of programming languages are oriented to the stack, which means that most defines basic operations (adding two numbers, printing a character) taking their arguments from the stack, and performing again the return values in the stack . For example, PostScript has a return stack and an operand stack, and also has a lot of graphics state stack and a dictionary.
Forth uses two stacks, one for passing arguments and a subroutine return address. The use of a stack of return is very common, but the use of an unusual argument for a stack is the human readable programming language Forth reason is called a stack-based language.
Many virtual machines are also stack-oriented, including the p-code machine and the Java virtual machine.
Almost all computing environments Runtime memory using a special battery BATTERY for information on the call of a procedure or function and nesting in order to change the context of the call to reset when the call ends. They follow a protocol of runtime between the caller and the call to save the arguments and return value on the stack. Stack is an important way of supporting nested or recursive function calls. This type of battery is used implicitly by the compiler to support CALL and RETURN statements (or equivalent), and is not directly manipulated by the programmer.
Some programming languages use the stack to store data that are local to a procedure. The local data space is allocated to items of the stack when the procedure is introduced, and are deleted when the procedure ends. The C programming language is usually applied in this way. Using the same pile of data and procedure calls has important security implications (see below), of which a programmer must be conscious to avoid the introduction of serious security errors in a program.