How to write a c program which has a large code section
I need to have a C program having a large code segment size (at least some MB)
I want to check out some behavior.

Here is the scenario :-
Run two processes, (process A) one having a large code segment size resided in the system RAM and other  process(B) which just eats up the system RAM ( a simple malloc+memset ).
Notice whether the resident set size of the process A decreases or some of its pages are swiped out or not before the exhaustion of the memory.
When I write a simple program the code segment size remains within the boundary of 1 page (4KB).



How to write a c program which has a large code section
===

I need to have a C program having a large code segment size (at least some MB)
I want to check out some behavior.

Here is the scenario :-
Run two processes, (process A) one having a large code segment size resided in the system RAM and other  process(B) which just eats up the system RAM ( a simple malloc+memset ).
Notice whether the resident set size of the process A decreases or some of its pages are swiped out or not before the exhaustion of the memory.
When I write a simple program the code segment size remains within the boundary of 1 page (4KB).


