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

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
509
Best answers
12
Reaction score
54
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:

Kaspar

Unprejudiced
Staff member
Global Moderator
Premium User
Joined
Jun 2, 2016
Messages
480
Best answers
2
Reaction score
311
Location
Sweden
The map is 10 times bigger, and the result in memory usage is also around 10 times bigger.
To me, it seems as it should.
 
OP
R

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
509
Best answers
12
Reaction score
54
The map is 10 times bigger, and the result in memory usage is also around 10 times bigger.
To me, it seems as it should.
but only map? script dont use anything?
 
OP
R

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
509
Best answers
12
Reaction score
54
Yep, scripts barely use any memmory compared to otbm maps. (especially on startup).
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?
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,532
Best answers
172
Reaction score
1,232
Location
Norway, Oslo
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.
 
OP
R

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
509
Best answers
12
Reaction score
54
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?
 

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
6,532
Best answers
172
Reaction score
1,232
Location
Norway, Oslo
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.
 
OP
R

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
509
Best answers
12
Reaction score
54
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.
 

Stigma

Veteran OT User
Joined
Feb 14, 2015
Messages
4,741
Best answers
419
Reaction score
2,301
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.
 

Kaspar

Unprejudiced
Staff member
Global Moderator
Premium User
Joined
Jun 2, 2016
Messages
480
Best answers
2
Reaction score
311
Location
Sweden
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.
 
Top