Symbian
Symbian OS Library

FAQ-0506 What are EPOC's limits?

[Index][spacer] [Previous] [Next]



 

Classification: General Category: Development
Created: 07/24/2000 Modified: 06/20/2001
Number: FAQ-0506
Platform: ER5

Question:
What are the upper limits for various areas in EPOC, For example maximum number of threads, processes, maximum file size, descriptor etc etc ?

Answer:
- what's the maximum number of bytes that can be allocated using malloc ?
The limit here is the amount of RAM available, with some additional theoretical limits imposed by the way that the EPOC address space is organised: the largest contiguous area of the address space is 0x40000000 bytes long (1 Gigabyte), so this would be restricted to 1 Gigabyte.

- what's the maximum number of processes
The limit for these is the limit on the maximum number of chunks, since each thread requires at least one chunk. Chunks each get a substantial piece of the virtual address space (multiple of 1 Megabyte), so there's a limit of about 500. Currently no limit apart from physical RAM size. However future implementations may impose a limit of 32 processes (due to MMU characteristics).

- what's the maximum number of threads per process ?
This is currently limited by the fact that each thread must have a chunk for its stack and heap. A chunk uses a minimum address space equal to the PDE size of the MMU (1Mb for ARM, 4Mb for X86). The total address space available to a process for stack/heap chunks is 508Mb. Thus you could have up to 508 threads on ARM and 127 on X86.

- what's the maximum data size that can be passed in client-server request ?
20 bytes! The actual RMessage contains 5 32-bit values: the function code and 4 parameters. To pass larger amounts of data, pass a pointer to a descriptor in one or more of the parameters, and access that descriptor from the server using ReadL and WriteL. That descriptor is subject to the RAM and descriptor limits described above.

- what's the maximum size of a file ?
Assuming the underlying filesystem can handle it, the EPOC RFile API allows for file sizes of up to 2 Gigabytes. EPOC supports VFAT file systems on CF cards (with the standard tradeoff between maximum and minimum sizes), and a different organisation for RAM drives.

- what's the maximum size of a file buffer when accessing a file ?
The length of a descriptor is limited to 2^28, which makes the theoretical limit for this 256 Megabytes.

- what's the maximum number of open handles (file, etc.) ?
Depends on the size of the kernel heap to hold both the handles and the kernel data structures they refer to. Note that handles have at most process-wide scope, so the maximum for the whole system is potentially larger than the maximum for an individual process. Each process has one handle array for process-global handles and each thread has one handle array for thread-local handles. Each handle array can hold up to 32767 handles - this includes all types of handle (file, window, semaphore, ...).

- maximum stack and heap size ?
The maximum address space available to a process is currently 508Mb. In some future implementations this may reduce to 32Mb due to MMU characteristics. The maximum heap size and stack size are currently unlimited apart from this (theoretical maximum of 1GB) . In future it is planned to impose a limit of around 64K of stack per thread.

- maximum data size in a shared memory ?
The limit here is the amount of RAM available, with some additional theoretical limits imposed by the way that the EPOC address space is organised: the largest contiguous area of the address space is 0x40000000 bytes long (1 Gigabyte), so this would be restricted to 1 Gigabyte.

- maximum bitmap size ?
The length of a descriptor is limited to 2^28, which makes the theoretical limit for this 256 Megabytes.