Stack Size : behind the code
How to know the stack size of a process in Linux? #Interview Question The stack word is very popular when it comes to C programming. It often intrigues us that how much is the stack size of a process and how to know it. The answer to this question can not be given without considering the "platform independent" thing. Well, we all are familiar with the word "platform independent". It is only word which comes to our mind when we don't know the answer. :P So, the stack size depends on the platform, the architecture - microprocessor is of how many bits - 16, 32, 64? But I will explain the answer with respect to Linux operating system. Method 1 The simplest method which I found is through cat /proc/-pid-/limits cat command is used to access a file. proc is a directory which contains information about all the running processes. -pid- is the process id of the process. We can know the process id of any process using ps -ef command. See man page of p...