Re: Method to calculate user space thread size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 2, 2013 at 7:55 PM, naveen yadav <yad.naveen@xxxxxxxxx> wrote:
> Dear All,
>
> I have very complex user space application contain more then 400 threads. I
> want to limit the stack size in user space, for this I want to know how much
> stack size each thread use in worst case.
>
> To calculate this is I need to modify in kernel ? or current kernel have any
> support ?
> or is there a method I can get from smaps?

try to check /proc/<pid>/status on VmStk line. But IMHO that indicates
the whole stack size (sum of all thread's stack size).

BTW, sure what you want to do is safe? what if you miscalculate it?
Certainly your application would crash some ways. So, maybe you need
other workaround. If you need to reserve memory, perhaps what you need
to do is doing malloc() wisely.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux