Revision 68b253ad
Added by Phil Davis almost 12 years ago
etc/inc/pfsense-utils.inc | ||
---|---|---|
1494 | 1494 |
function pfsense_default_state_size() { |
1495 | 1495 |
/* get system memory amount */ |
1496 | 1496 |
$memory = get_memory(); |
1497 |
$avail = $memory[1];
|
|
1497 |
$physmem = $memory[0];
|
|
1498 | 1498 |
/* Be cautious and only allocate 10% of system memory to the state table */ |
1499 |
$max_states = (int) ($avail/10)*1000;
|
|
1499 |
$max_states = (int) ($physmem/10)*1000;
|
|
1500 | 1500 |
return $max_states; |
1501 | 1501 |
} |
1502 | 1502 |
|
Also available in: Unified diff
Use hw.physmem when calculating pfsense_default_state_size
hw.physmem is the actual amount of memory that FreeBSD/pfSense can get its hands on, so use this for the calculation.
Backport to 2.1