Ask a Question related to Sun Solaris, Design and Development.
-
cljlk #1
array in C program
How do I determine what the maximum of array I can use in C program?
I have Sun Solaris. How many array I can declare, I know it depends on
memory.
If I have set line[100000] in my C program, how many memory do I need?
Thanks
cljlk Guest
-
PDF and program won't open; "Error in Acrord32" "This program has performed an illegal operation and
I recently had a browser hijacker. Fixed it with Norton and Lavasoft. Now, after downloading new Reader 6.0, I can't open anything. Only gives... -
[newbie]saving and reading array of associative array
i'm looking for examples of saving to file and reading back an array of associative array, in a ruby like way. saying i have something like : ... -
array data matches but array created in loop doesn't work
I have the exact same data in two arrays, but only the array created like so will work: $spaw_imglibs = array( array( 'value' =>... -
#24897 [Com]: array_multisort() will reindex the array but not if array length is 1
ID: 24897 Comment by: franklin_se at hotmail dot com Reported By: chro at sokrates dot uio dot no Status: ... -
#24897 [Opn->Asn]: array_multisort() will reindex the array but not if array length is 1
ID: 24897 Updated by: sniper@php.net Reported By: chro at sokrates dot uio dot no -Status: Open +Status: ... -
Alan Coopersmith #2
Re: array in C program
"cljlk" <cljlk@hotmail.com> writes in comp.unix.solaris:
|How do I determine what the maximum of array I can use in C program?
|I have Sun Solaris. How many array I can declare, I know it depends on
|memory.
You divide the maximum memory your program can allocate by the size
of the array members.
The maximum memory your program can allocate is the smallest number on
this list:
- the total amount of virtual memory (RAM + swap) free at runtime,
minus whatever overhead your program needs to load itself and
set up it's stack (see the "available" number in 'swap -s')
- Approx. 3.9GB if running a 32-bit process on a recent Solaris
- the value of ulimit -d if it's not set to 'unlimited'
|If I have set line[100000] in my C program, how many memory do I need?
100000 times the size of whatever datatype that variable is.
If it's a char, 100000 bytes. If it's an int, 400000 bytes.
--
__________________________________________________ ______________________
Alan Coopersmith [email]alanc@alum.calberkeley.org[/email]
[url]http://www.CSUA.Berkeley.EDU/~alanc/[/url] aka: [email]Alan.Coopersmith@Sun.COM[/email]
Working for, but definitely not speaking for, Sun Microsystems, Inc.
Alan Coopersmith Guest
-
Wayne #3
Re: array in C program
Alan Coopersmith wrote:
Actually it depends if the array is a local variable (on the stack)> "cljlk" <cljlk@hotmail.com> writes in comp.unix.solaris:
> |How do I determine what the maximum of array I can use in C program?
> |I have Sun Solaris. How many array I can declare, I know it depends on
> |memory.
>
> You divide the maximum memory your program can allocate by the size
> of the array members.
or a global variable (on the heap). You program has a fixed size
stack (than can be adjusted with some ELF/ld tweaks), but the heap
can grow to the max ram size allowed for a process on your system.
-Wayne
Wayne Guest



Reply With Quote

