server memory leak?
#1

Hi,

I've made some tests on an blank server and I've noticed a memory leak.

After a player connects to the server, for each Join Packet(received by the OnPlayerConnect) sent by the client, the server will use ~0.1MB additional memory.
After the player disconnects from the server, the memory used by extra packets wont be freed.

So, if a player will send 1000 Join Packets, my server will "lock" ~100 MB of memory.

How could this be fixed? How can I prevent a player from overloading my server?
Reply
#2

That doesn't seem right, are you sure you not using any plugins?

Try limiting the number of clients per ip.
Reply
#3

Well this hasn't been reported so it shouldn't be anything too radical. Basically, the memory should free up after samp-server is closed so it shouldn't hurt your machine.

And also it shouldn't be too much of an effect to cause an impact on your server.
Reply
#4

Quote:
Originally Posted by Aasim
Посмотреть сообщение
That doesn't seem right, are you sure you not using any plugins?

Try limiting the number of clients per ip.
As I said, it is a blank server, it doesn't have any plugins nor filterscripts.
Limiting the number of clients per IP is not a solution, as the overload of the server can be done with one client.
Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Well this hasn't been reported so it shouldn't be anything too radical. Basically, the memory should free up after samp-server is closed so it shouldn't hurt your machine.

And also it shouldn't be too much of an effect to cause an impact on your server.
The memory will be freed after the samp-server will close.
The problem is that if someone will flood the server, the samp-server will finally crash.
So 'the Attacker' would be able to keep my server down.
Reply
#6

I'm not sure about this.

I've gotten over 5000 connected players in 1 day and my ram usage doesn't even go over 200mb
Reply
#7

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Well this hasn't been reported so it shouldn't be anything too radical. Basically, the memory should free up after samp-server is closed so it shouldn't hurt your machine.

And also it shouldn't be too much of an effect to cause an impact on your server.
What a stupid reply, but I suppose it should be expected from someone with a "free jansish" signature.

Memory leaks don't "hurt the machine", they hurt the application because it will eventually run out of memory. Big servers run samp-server for days or weeks at a time without restarting - if this problem is actually a memory leak, every server would be screwed.
Reply
#8

Quote:
Originally Posted by tp
Посмотреть сообщение
As I said, it is a blank server, it doesn't have any plugins nor filterscripts.
Limiting the number of clients per IP is not a solution, as the overload of the server can be done with one client.
Looks to me like the leak is coming from a native library from your machine, the samp-server binary uses a couple of libraries, it's most likely that your machine has bad lib files.
Reply
#9

Quote:
Originally Posted by Aasim
Посмотреть сообщение
Looks to me like the leak is coming from a native library from your machine, the samp-server binary uses a couple of libraries, it's most likely that your machine has bad lib files.
Correct me if I'm wrong, but aren't libraries used compiled and linked together with the binary? So it wouldn't matter what binaries he has. Furthermore, if this truly is an SA-MP issue, wouldn't it more likely be a programming mistake instead of a library fault, seeing as this is the first time it has been reported ever since SA-MP started, in a recently modified field, while I doubt any massive library changes have occurred.
Reply
#10

Quote:
Originally Posted by Aasim
Посмотреть сообщение
Looks to me like the leak is coming from a native library from your machine, the samp-server binary uses a couple of libraries, it's most likely that your machine has bad lib files.
I don't think so. I've tested it on Windows and Linux.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)