OpenTTD using 3.8 GB memory and still rising

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

OpenTTD using 3.8 GB memory and still rising

Post by Samu »

Hi all! I'm back to this game. Don't know if you guys still remember me, but I'm going to play this game again in the following days.

I am now on a new computer and decided to see how fast it would go on a giant map 2048x2048 with 14 AIs. I started a game in 1950 and now in the year 2005 it has become incredibly sluggish. Mouse cursor only moves once per 3 seconds and memory usage is up to 3.8 GB.

I though a computer such as this would roll over OpenTTD but I guess I'm wrong.

EDIT: Ops, Computer specs - Intel Core i5 2500, AMD Radeon HD 6850, 12 GB RAM 1333 MHz CL9 Dual-channel, Windows 7 Ultimate 64-bit, 1TB Western Digital Caviar Blue.
User avatar
Chris
Tycoon
Tycoon
Posts: 1985
Joined: 05 Oct 2009 16:36
Location: Leeds, UK

Re: OpenTTD using 3.8 GB memory and still rising

Post by Chris »

CPU clockspeed?
Screenshots

Formerly Class 165
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: OpenTTD using 3.8 GB memory and still rising

Post by Eddi »

a friend of mine in bio-computer-sciences once said: "why do you celebrate so much that computers get twice as fast? we will just use one atom more in the simulation, and it will bring it down to its knees."
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

3.3 GHz, up to 3.7 GHz with turbo
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

Currently 4.2 GB RAM, game year 2008
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2849
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: OpenTTD using 3.8 GB memory and still rising

Post by ChillCore »

I remember you. ;)

Very big map and many AIs. This is behaviour to be expected.

Are you using vanilla OpenTTD or a patched version? If vanilla what version and if patched what patch?
What are the AIs you are running; each one is a program (script) running on top of OpenTTD. And some of them might slow down OpenTTD; sometimes because of wasting memory, sometimes because of not having optimized code (the same goes for patches).
Are you using many GRFs in your game?

Could you post your savegame please. That will tell us more than a thousend words. ;)
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: OpenTTD using 3.8 GB memory and still rising

Post by PikkaBird »

Samu wrote:3.3 GHz, up to 3.7 GHz with turbo
"Turbo"? Is this 1992 or something? :lol:

Sounds like one of the running AIs has a memory leak...
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

Oh just noticed there's a new version.That's a 1.2.0 savegame.

Using 4.5 GB RAM now, year 2010.
Attachments
Unnamed, 2010-03-26.sav
(3.27 MiB) Downloaded 152 times
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

5.1 GB memory usage, game year 2016, but now I'm gonna sleep. Tomorrow I'll continue
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: OpenTTD using 3.8 GB memory and still rising

Post by Eddi »

try this:
  1. make a savegame
  2. go to the ingame console
  3. type stop_ai 1
  4. watch the memory and cpu usage
  5. repeat the previous two steps for numbers 2-15
  6. report the results to the respective AI authors.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: OpenTTD using 3.8 GB memory and still rising

Post by FooBar »

Yes, it must be one or more of the AIs. I loaded the game on a much less powerful computer than yours, but without AIs. And then it runs just fine.
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

When I loaded the savegame today, it wasn't back to 5.1 GB usage, it was starting over.

It's year 2050, i saved game and now i'm gonna kill the AIs, though I would prefer if I could keep their vehicles, making them have no one controlling them.

Okay, memory usage:

1.723.916K - all
1.723.916K - stop_ai 1 - WARNING: Company is not controlled by an AI
1.723.916K - stop_ai 2 - AI stopped, company deleted - PathZilla (v6) with error but some vehicles (0/168/0/0)
1.724.092K - stop_ai 3 - AI stopped, company deleted - TeshiNet (v4) with error, Unnamed (0/0/0/0)
1.724.092K - stop_ai 4 - AI stopped, company deleted - BorkAI (v7) with error, Unnamed (0/0/0/0)
1.724.092K - stop_ai 5 - AI stopped, company deleted - Convoy (v11) alive with vehicles (0/1448/0/0)
1.724.092K - stop_ai 6 - AI stopped, company deleted - SynTrans (v10) alive with vehicles (0/32/0/0)
1.724.092K - stop_ai 7 - AI stopped, company deleted - Convoy (v11) alive with vehicles (0/1768/0/0)
1.724.092K - stop_ai 8 - AI stopped, company deleted - Terron (v203) alive with vehicles (0/2442/64/0)
1.724.092K - stop_ai 9 - AI stopped, company deleted - Denver & Rio Grande (v1) alive with vehicles (13/0/0/0)
1.358.388K - stop_ai 10 - AI stopped, company deleted - NoCAB (v498) alive with vehicles (0/0/7/0)
1.359.472K - stop_ai 11 - AI stopped, company deleted - StreetTraffic (v1) alive but no vehicles (0/0/0/0)
1.364.692K - stop_ai 12 - AI stopped, company deleted - NoCAB - Bleeding Edge Edition (v523) with error, Unnamed (0/0/0/0)
1.367.988K - stop_ai 13 - AI stopped, company deleted - MogulAI (v5900) alive with vehicles (0/5000/0/0)
389.536K - stop_ai 14 - AI stopped, company deleted - Terron (v203) alive with vehicles (0/1830/44/0)
325.180K - stop_ai 15 - AI stopped, company deleted - RoadRunner (v7) alive but no vehicles (0/0/0/0)

RoadRunner, Denver, Terron (AI 8), PathZilla were the longest living companies, since 1950.
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

Did you come to any conclusion to what was the problem?
Arie-
Director
Director
Posts: 593
Joined: 20 Jan 2009 16:07

Re: OpenTTD using 3.8 GB memory and still rising

Post by Arie- »

Yes, as you can see he posted the game resource size each time after he killed an AI. You can now find how big the chunk of memory was each AI used. The names of the biggest AI's he also wrote in the last line of his post.
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: OpenTTD using 3.8 GB memory and still rising

Post by Samu »

Erm... what I can say is that the biggest differences were after killing NoCAB (v498), from 1754 to 1358. The other one doesn't make sense to me. Killing the second Terron has freed nearly 1 GB memory, but when the first Terron was killed, it made no effect.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: OpenTTD using 3.8 GB memory and still rising

Post by Eddi »

you should ask that in the respective threads in the AI forum
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: OpenTTD using 3.8 GB memory and still rising

Post by frosch »

It could be pending events. AIEvents are shared between all AI instances and are freed when the last reference is destroyed. So, if one AI never queries events, they will stockpile. They will only be freed when all AIs are killed, which do not query events.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 8 guests