server icon indicating copy to clipboard operation
server copied to clipboard

64x Tfs 1.1 - Crash after 15 minutes with npcs / 48 hours stable without npcs

Open Fle-OTL opened this issue 10 years ago • 14 comments

Hey my server is crashing every 15 minutes when I have the npcs loaded, does anybody have this issue?

using orts datapack

Fle-OTL avatar Apr 15 '15 11:04 Fle-OTL

you compiled in your computer?

Schiffers avatar Apr 15 '15 12:04 Schiffers

yes I compiled in my computer

Fle-OTL avatar Apr 15 '15 13:04 Fle-OTL

64bit Version is bugged. Try the 32bit version

Royalot avatar Apr 15 '15 13:04 Royalot

this is a very known issue here, so this is a duplicate or whatever you guys may call it as @TheSumm said in the other issue: it is low priority until we can really track down it

EPuncker avatar Apr 15 '15 18:04 EPuncker

has there been any luck tracking the cause of crashes caused by npcsystem?

Fle-OTL avatar May 04 '15 13:05 Fle-OTL

Not really, but Mark said yesterday that it might be the npc lib files(https://otland.net/threads/the-forgotten-server-1-1.232064/#post-2236784) So try to use the npc libs from the forgottenserver datapack, you will get alot of errors but it should still start. Then check how much ram it's using.

If it's the same then try to remove 10 npc files at a time till you have narrowed it down to a few npcs.

WibbenZ avatar May 04 '15 14:05 WibbenZ

Reload the NPCs is a burdensome task for the server. Try updating everything and then restarted if possible.

rodrigoslayertech avatar May 04 '15 15:05 rodrigoslayertech

how are the soluction to this problem? are crashing yet?

Schiffers avatar May 20 '15 23:05 Schiffers

still crashing.. no luck finding the cause.

ninja said it may be the custom modules in the npc system..

Heres what he said - Ninja - "Search for these: npcHandler:addModule(VoiceModule keywordHandler:addSpellKeyword keywordHandler:addAliasKeyword focusModule:addGreetMessage focusModule:addFarewellMessageand comment them out by using -- Let me know if there is any change in memory usage."

I tried this... also.. I tried removing the dofile('data/npc/lib/npcsystem/customModules.lua') from C:\Ot Project\tfs1.1\data\npc\lib -npc.lua

But i get many errors when i do this and some npcs dont load, and the server still crashes

I think this has too do with continuation passing style that is taking place without reason repeatedly eating memory until tfs crashes.

This is my unprofessional opinion!

-Martin

Fle-OTL avatar May 26 '15 12:05 Fle-OTL

I think the reason the 32x is more stable, is because your memory is capped

However in 64x there is no memory cap and something is eating memory (some type of broken or outdated callback possibly?) I have no idea.

wish this were fixed.

Fle-OTL avatar May 26 '15 12:05 Fle-OTL

"something eating memory" have a chance that have a inifite loop that are geting all memory and the tfs crash for memory end ? @Fle-OTL you say about the 32x and 64x, but bro, how you will load the map in 32x ? the server is for 64x to can load the map and all modules without problem

Schiffers avatar May 26 '15 13:05 Schiffers

This issue has been around since the start (late 2013(?)) of this project so I doubt there's anything wrong with the changes we have added recently.

I made a minor test on x86 with 200 NPCs (linked to the same script, default.lua) and default TFS libs (and ORTS libs). The memory usage by the server increased with either 4 or 8kb per second (and let's say 30kb with 800~ NPCs).

How much does the memory usage increase for you on x64?

dbjorkholm avatar Jun 17 '15 09:06 dbjorkholm

Done some more research: Removed 489 NPCs (50% ~) It goes now up 16kb insted of 30-50kb.

And if I use the other 341 (50% ~) NPCs that I removed before it goes up by 36 bytes. I have now started going in alfabetical order:

A: They seem to leak at random intervals at 4 bytes per interval.

B, C, D, E, F, G, H, I, J, K, N: Q, S, U, V, W, X, Z, Y Seems stable, look like TFS is eating memory at startup and then releases it. After a while it goes back down and is stable.

L: Is leaking, it takes a while but then starts leaking at 4kb / 5-10 sec. M: Is also leaing, takes about the same interval as L, at 4kb. O, P: Both leak, P leaks more then O. When P has leaked 8kb O has leaked 4kb ~ R, T: Leaks 4mb pretty much every 2-4 seconds.

Used the ORTS libs, TFS 64bit release (latest version) and the task manager to see if it leaks or not. You should wait a while before you check if it leaked or not, as I said above TFS seems to be leaking abit in the beginning(after start) but then gets cleared after a while). So let it idle for a couple of mins then check if it increases (wait 30-60 seconds).

Final edit: Ive checked all NPC files, L, M, O, P, R, T leaks memory. This will help to locate the exact files insted of taking them out one by one etc.

WibbenZ avatar Jun 17 '15 20:06 WibbenZ

This crash occurs only in Windows ?

ghost avatar Feb 05 '16 18:02 ghost