Operating System - HP-UX
1833178 Members
3141 Online
110051 Solutions
New Discussion

Re: Memory (RAM) usage and quota

 
SOLVED
Go to solution
Oliver Schmitz
Regular Advisor

Memory (RAM) usage and quota

Dear all,

a few weeks ago I switched on the quota for the users on our hp-ux WS. I as a user accessed today some programms which are used to evaluate big amounts of data. Before the quota was switched on these programms worked fine. Now the don' t anymore.

Is there any connection between the quota limited disk usage and the freedom to use all memory? Is there any othe daemon limmiting the memory usage?

Thanks for some hints,

Oliver
Oliver Schmitz
3 REPLIES 3
Oliver Schmitz
Regular Advisor

Re: Memory (RAM) usage and quota

Hi again,

I forgot to describe the problem when using my C routines: They compile (GNU C) without problems. In the beginning I declare some big arrays with fixed size of 100MB. Alltogether 350 MB of memory (4.5 GB inside) are supposed to be used.

My programm ends with a segmentation fault (core dumped). When I declare my array one order less (10 MB each) for test purposes, the programm runs as intended.

Thanks and best regards,

Oliver
Oliver Schmitz
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Memory (RAM) usage and quota

Quotas are disk only; they have nothing to do with memory. This is much more likely to be a problem with the kernel settings of maxdsiz (or possibly maxssiz if these arrays auto declared). If this is 32-bit code then you are probably seeing an artifact of memory fragmentation. By the way, you seem to be saying that you are declaring statically sized arrays. When you get into data strucxtures this large, it is considered much better form to use dynamically allocated arrays -- and they are just as convenient to address.

For example, suppose that you need an array of doubles:

double *fake_array = NULL;
int sz = 100000;

fake_array = (double *) calloc((size_t) sz,sizeof(double);
if (fake_array != NULL)
{ /* all ok */
fake_array[0] = 5.0;
fake_array[6] = 6.789;
/* finally, when finished */
free((void *) fake_array);
fake_array = NULL;
}
else
{
fprintf(stderr,"Can't allocate memory (%d)\n",errno);
}

You can use another level of indirection and get multi-dimensional arrays and you can even use realloc to grow arrays 'on the fly'. This is a much better technique than simply declaring large arrays.


If it ain't broke, I can fix that.
Sanjay_6
Honored Contributor

Re: Memory (RAM) usage and quota

Hi Oliver,

My guessis that after you switched the quota, the system is unable to create the temporary file while it is evaluating the data. You are probably limiting the size of the amount of disk space the user can use and that could be creating problem when the program is trying to use more disk space while working on the data. This may not be a memory issue.

Hope this helps.

Regds