RAM profiler
#1

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.
Reply
#2

Yeah that's pretty good. I'll back this!
Reply
#3

Do you have a shortage of RAM? Most scripts nowadays don't even exceed 100MB.
Reply
#4

Quote:
Originally Posted by Vince
View Post
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.
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by Gazzy
View Post
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+.
Reply
#7

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.
Reply
#8

Quote:
Originally Posted by Slice
View Post
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?
Reply
#9

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)