Operating System - HP-UX
1830081 Members
2506 Online
109998 Solutions
New Discussion

how to find How much memory can a process use

 
Asif_8
Regular Advisor

how to find How much memory can a process use

Hi !

How to find How much memory can a process use

thanks
5 REPLIES 5
Anshumali
Esteemed Contributor

Re: how to find How much memory can a process use

check maxssiz_64bit(stack), maxtsiz_64bit(text), maxdsiz_64bit(data) in kernel parameters...online monitoring-->check with Glance.
Dreams are not which you see while sleeping, Dreams are which doesnt allow you to sleep while you are chasing for them!!
Asif_8
Regular Advisor

Re: how to find How much memory can a process use

My system use 99% memorey I want to know which application or process take more memorey

Andrew Young_2
Honored Contributor

Re: how to find How much memory can a process use

Hi.

Also check the user limit for the user that the process runs as.

Login as the user (or su - username) and run ulimit -a

Regards

Andrew Y
Si hoc legere scis, nimis eruditionis habes
A. Clay Stephenson
Acclaimed Contributor

Re: how to find How much memory can a process use

To view the most intensive processes in reverse order:

UNIX95=1 ps -e -o vsz,pid,comm | sort -rn | pg
If it ain't broke, I can fix that.
Jean-Yves Picard
Trusted Contributor

Re: how to find How much memory can a process use

Hello,

this is a complex question

I wrote program bellow to see it.

text size (3th field) is share among all insances, data, stack and uarea are private.

Jean-Yves Picard

/* compile with (if 64 Bit): cc +DA2.0W -D_PSTAT64 -o my_ps my_ps.c */
#include

#include
#include
#include


#define BURST ((size_t)10)
main() {
long gid ;
struct pst_status pst[10];
int retour ;

{

int i, count;
int idx = 0; /* index within the context */
int c = 0 ;
char *lignecomm ;
/* loop until count == 0, will occur all have been returned */
while ((count=pstat_getproc(pst, sizeof(struct pst_status),BURST,idx))>0) {
/* got count (max of BURST) this time. process them */
for (i = 0; i < count; i++) {
lignecomm=pst[i].pst_cmd ;
if ( lignecomm[0] == 10 ) lignecomm = &(pst[i].pst_cmd[1]) ;
(void)printf("%3d :pid is %d,\n",c++, pst[i].pst_pid );
(void)printf("\t ligne de commande %s \n",lignecomm);
(void)printf("\t executable est %s \n",pst[i].pst_ucomm);

printf ("! \t%d",pst[i].pst_pid);
printf ("\t%d",pst[i].pst_dsize);
printf ("\t%d",pst[i].pst_tsize);
printf ("\t%d",pst[i].pst_ssize);
printf ("\t%d",pst[i].pst_usize);
(void)printf("\t%s",pst[i].pst_ucomm);
(void)printf("\t%s\n",lignecomm);

/* (void)printf("%3d :pid is %d, command is %s\n",c++, pst[i].pst_pid, pst[i].pst_ucomm);*/
}
/*
* now go back and do it again, using the next index after
* the current 'burst'
*/
idx = pst[count-1].pst_idx + 1;
}

if (count == -1)
perror("pstat_getproc()");
}

}