• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows CPU usage map 3 mb X map 35mb (10x memory)

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
Hi, i'have compiled tfs 1.3.
With a default map (weighs 3 megabytes). Memory usage is 105,4MB.

Only changing the map for another that wheight 35megabytes. Memory usage is 1017,2MB. (10x more).
Its correct or i have some problem?


1565742139273.png
 
Last edited:
Solution
I understand, but in my case, the first map (weighs 3 megabytes)) consumes 100MB after the map already loaded (with the online game).
And the 35 meg map consumes 1000MB after it's loaded. (not while loading the map)
That makes sense?

Yep, because after its done loading, you need to keep it in RAM, so its super quick to access the parts of it that is needed when players login, click on minimap etc. And so scripts can quickly access different parts of the map, and so monsters can be spawned in the map, so house items can be loaded to it etc.
can i state that the map consumes memory and the scripts consume processor? (on a larger scale)
or is it a mistake to state this?

Yep, correct. Scripts are being processed all the time, acting as an API to the server engine for easy manipulation and customisation of an OT without the need to edit source code and recompile a server.

The map is being loaded only on startup (but it might load slow here, and cost much CPU resources during this loading phase). But once its loaded into RAM there is no significant CPU usage just because the map is bigger. I believe @Evil Hero back in the days experimented with dynamic map loading through Lua, and even that was surprisingly fast.
 
Yep, correct. Scripts are being processed all the time, acting as an API to the server engine for easy manipulation and customisation of an OT without the need to edit source code and recompile a server.

The map is being loaded only on startup (but it might load slow here, and cost much CPU resources during this loading phase). But once its loaded into RAM there is no significant CPU usage just because the map is bigger. I believe @Evil Hero back in the days experimented with dynamic map loading through Lua, and even that was surprisingly fast.
I understand, but in my case, the first map (weighs 3 megabytes)) consumes 100MB after the map already loaded (with the online game).
And the 35 meg map consumes 1000MB after it's loaded. (not while loading the map)
That makes sense?
 
I understand, but in my case, the first map (weighs 3 megabytes)) consumes 100MB after the map already loaded (with the online game).
And the 35 meg map consumes 1000MB after it's loaded. (not while loading the map)
That makes sense?

Yep, because after its done loading, you need to keep it in RAM, so its super quick to access the parts of it that is needed when players login, click on minimap etc. And so scripts can quickly access different parts of the map, and so monsters can be spawned in the map, so house items can be loaded to it etc.
 
Solution
Yep, because after its done loading, you need to keep it in RAM, so its super quick to access the parts of it that is needed when players login, click on minimap etc. And so scripts can quickly access different parts of the map, and so monsters can be spawned in the map, so house items can be loaded to it etc.
@Znote and @Stigma
thanks for clarifying!
I admire those who have such knowledge and share them.
 
Yes. The bigger the map, the more memory will be consumed by TFS.
You're probably expecting it to only increase by around 35mb, because that's the map size. But that isn't the case, since the engine has to load each and every single item, and set up tiles, put the items in the tiles, etc. which all have data structures that take up a small amount of memory. With hundreds of thousands of tiles and items, all of those small data structures add up and consumes more memory.
 
Something worth noting is that you can allocate more minimum RAM to the server, and then keep the maximum amount of RAM accessible by the server a lot higher. That may help the startup of the server a lot, so it goes faster and smoother.
Just make sure that you're not allocating too much minimum RAM than needed for the startup of the server than necessary.
 
Back
Top