bitburner-src/markdown/bitburner.ns.ramoverride.md

1.2 KiB

Home > bitburner > NS > ramOverride

NS.ramOverride() method

Change the current static RAM allocation of the script.

Signature:

ramOverride(ram?: number): number;

Parameters

Parameter Type Description
ram number (Optional) The new RAM limit to set.

Returns:

number

The new static RAM limit, which will be the old one if it wasn't changed. This means you can use no parameters to check the current ram limit.

Remarks

RAM cost: 0 GB

This acts analogously to the ramOverride parameter in runOptions, but for changing RAM in the current running script. The static RAM allocation (the amount of RAM used by ONE thread) will be adjusted to the given value, if possible. This can fail if the number is less than the current dynamic RAM limit, or if adjusting upward would require more RAM than is available on the server.

RAM usage will be rounded to the nearest hundredth of a GB, which is the granularity of all RAM calculations.