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

40 lines
953 B
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getServerRam](./bitburner.ns.getserverram.md)
## NS.getServerRam() method
Returns an array with two elements that gives information about a servers memory (RAM). The first element in the array is the amount of RAM that the server has total (in GB). The second element in the array is the amount of RAM that is currently being used on the server (in GB).
<b>Signature:</b>
```typescript
2021-10-30 21:46:34 +02:00
getServerRam(host: string): [number, number];
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-10-30 21:46:34 +02:00
| host | string | Host or IP of target server. |
2021-10-30 18:34:14 +02:00
<b>Returns:</b>
\[number, number\]
Array with total and used memory on the specified server.
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 0.1 GB
2021-10-30 18:34:14 +02:00
## Example
2021-10-30 21:46:34 +02:00
```ts
2021-10-30 18:34:14 +02:00
res = getServerRam("helios");
totalRam = res[0];
ramUsed = res[1];
```