MySQL: Huge memory usage!
#1

Well, recently I converted my server from dini to MySQL, while on dini, it usually used like 7.5 % Memory with about 16 or more players. Now it gradually goes up till about 111% of Memory. I opened a support ticket and the representative said that it's a possible leak. I've free'd all the results after using mysql_store_result. I can't see where in my script it's causing a leek. I'd be glad if anyone could help me with this problem. There are some pictures below of what it looks like




Oh by the way it's Volt-Host.
Reply
#2

It's hard to help without seeing the code.
Reply
#3

Are you sure thats the MySQL fault?
Reply
#4

You need to be more specific, if you think it's MySQL - you should at the very least point out which plugin you're using.
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
It's hard to help without seeing the code.
My code is 19,771 lines and I know you won't steal it if I post it but there will be other culprits. But maybe you can tell me what I might be doing wrong to make it use so much memory; I've read ******' optimization topic over and over.

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
You need to be more specific, if you think it's MySQL - you should at the very least point out which plugin you're using.
G-sTyLeZzZ's MySQL R5 plugin.
Reply
#6

Put this in your code and post the results.
pawn Код:
mysql_debug(1);
It will create a txt file named "debug" in your server directory. You might be able to fix it with that information by yourself.
Reply
#7

I did that and it said the result has been free'd.
Reply
#8

Then you need to provide more information, or people are just stabbing in the dark. If you have free'd all results i can't see it being a mem leak from mysql. I'm not sure but i don't think there is any other function in that plugin that uses dynamic memory - that the user has to free.
Reply
#9

Hmm, i'll look through my script and the debug again.
Reply
#10

(I happened to saw the code you posted before)

pawn Код:
if(mysql_num_rows() != 0)
if mysql_num_rows() is not 0, you will free the result, but what if it is 0 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)