RAM profiler - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Discussion (
https://sampforum.blast.hk/forumdisplay.php?fid=84)
+---- Thread: RAM profiler (
/showthread.php?tid=587006)
RAM profiler -
Tamer - 27.08.2015
We've got profiler to profile CPU usage. But we don't have one for RAM. I was going to ask if anyone here is interested to build one like Zeex did, which would show to which partitions of the script is the RAM usage going to.
Re: RAM profiler -
BleverCastard - 27.08.2015
Yeah that's pretty good. I'll back this!
Re: RAM profiler -
Vince - 27.08.2015
Do you have a shortage of RAM? Most scripts nowadays don't even exceed 100MB.
Re: RAM profiler -
Tamer - 27.08.2015
Quote:
Originally Posted by Vince
Do you have a shortage of RAM? Most scripts nowadays don't even exceed 100MB.
|
I rather say that I want to know where my RAM usage goes to. Not that I am on shortage. But I want to know where it goes to. Also, there are lots of scripts which exceed 100mb. So those people would benefit as well.
Re: RAM profiler -
Gazzy - 27.08.2015
Scripts that exceed 100mb of RAM are most likely using RAM that can be prevented from being used. If people optimised their script a bit more it wouldn't exceed 100mb of RAM, however I do back this idea as it does look like a good idea but it might not be needed by many people, still a nice way to monitor your server more.
Re: RAM profiler -
Crayder - 28.08.2015
Quote:
Originally Posted by Gazzy
Scripts that exceed 100mb of RAM are most likely using RAM that can be prevented from being used. If people optimised their script a bit more it wouldn't exceed 100mb of RAM, however I do back this idea as it does look like a good idea but it might not be needed by many people, still a nice way to monitor your server more.
|
Ram usage is based mostly on how much allocation a script needs and the allocation the plugins' need. You can have a really small script that hardly uses over a single mb and a plugin that uses 350+.
Re: RAM profiler -
Slice - 06.10.2015
You could use
this to read the AMX debug information with JavaScript., or
this to read it with PHP (old, but works).
If you want to do it in Pawn, you'll need to wire up
samp-introspect and use GetVariableInfo to find out what's taking up all the space.
It won't help you if you use PVars though. If you're using a bunch of PVars you should be ashamed of yourself, anyway.
Re: RAM profiler -
Tamer - 06.10.2015
Quote:
Originally Posted by Slice
You could use this to read the AMX debug information with JavaScript., or this to read it with PHP (old, but works).
If you want to do it in Pawn, you'll need to wire up samp-introspect and use GetVariableInfo to find out what's taking up all the space.
It won't help you if you use PVars though. If you're using a bunch of PVars you should be ashamed of yourself, anyway.
|
How can I use those, in instance, the javascript one?
Re: RAM profiler -
Slice - 06.10.2015
In Node.JS, something like this:
Code:
var AMX = require('amx').AMX;
var fs = require('fs');
var util = require('util');
var amx_data = new AMX(fs.readFileSync('filename.amx'));
console.log(util.inspect(amx_data, { showHidden: true, depth: null }));
You could do it in modern browsers also, as long as you know how to get a Buffer from a file upload.