To dump the top-level heap in a memory area use:
ALTER SESSION SET EVENTS 'immediate trace name heapdump level level';
Levels are:
| Level | Description |
| 1 | PGA summary |
| 2 | SGA summary |
| 4 | UGA summary |
| 8 | Callheap (Current) |
| 16 | Callheap (User) |
| 32 | Large pool |
| 64 | Streams pool |
| 128 | Java pool |
| 1025 | PGA with contents |
| 2050 | SGA with contents |
| 4100 | UGA with contents |
| 8200 | Callheap with contents (Current) |
| 16400 | Callheap with contents (User) |
| 32800 | Large pool with contents |
| 65600 | Streams pool with contents |
| 131200 | Java pool with contents |
Levels are correct to Oracle 10.2.0.1
The levels can be combined. For example a level 3 dump will contain both the PGA and SGA