Home
>
2. Usage
>
2.2 Options
>
2.2.1 Start up Parameters
|
Previous
Next
|
|
|
|
|
|
to run the ampolice in active mode since
startup
DEFAULT VALUE : by default the
AMPolice is not logging any information. To make AMPolice monitor
anything and log anything use the ampsignal command.
EXAMPLE
1. Start ampolic "ampolice <parameters without
"-a" option> <Ur binary with Parameters>"
2. Use ampsignal to start logging "./ampsignal
PID start"
3. Use ampsignal to stop logging "./ampsignal PID
quit"
4. Use ampsignal to log the data in the log file
"./ampsignal PID delta"
5.Use ampsignal to quit the program "./ampsignal
exit"
TIP: running AMPolice in verbose mode can
be very much annoying because output from application and AMPolice
can mix up and due to limitation of display settings important
information will lost.
|
|
To tell AMPolice not to log the first n
allocation after starting up.
TIP: use this option when you know that
your application a big chunk of allocations at start up and you
don't want/expect to detect a memory leak in this section of your
run time.
----------------------------------------------------------------------------------
-------
|
|
Options provides the location of the
libAMPolice.so lib to AMPolice.
TIP: This option is used if libAMPolice.so
is not installed in your library path. Benefit, user doesn't needs
root access to install/copy the libAMPolice.so in default library
paths.
-----------------------------------------------------------------------------------------
|
|
Option enables the AMPolice to output the byte
counts, it is not a human readable format.
-----------------------------------------------------------------------------------------
|
|
Options clears all the options stored so far
inside the AMPolice.
-----------------------------------------------------------------------------------------
|
|
's' is the debug string that you want to debug
particularly for the purpose of leak detection.
TIP: if you know the symbol that is part
of the leak, use it here and control the output in terms of quality
and size.
-----------------------------------------------------------------------------------------
|
|
lowest possible size value of a allocation to be
logged.
TIP: Use this option if you want to
restrict the AMPolice from logging the allocs which are lower in
size as compared to a certain value . We use this option to narrow
our search for leak detection.
-----------------------------------------------------------------------------------------
|
|
to log the current status of AMPolice internals
every "i" seconds
History : While we were developing and
testing the AMPolice we had cases in which we didn't found leaks
after running the application. Idea struck that application could
be having functional memory leaks. So in order to detect functional
leaks with syntactical memory leaks we decided to have this option
that we print our memory internals after certain amount of time as
snapshot view.
TIP: if feel that application design is
faulty and ur free is only called when u exit the application use
this option to detect the leaks.
-----------------------------------------------------------------------------------------
|
|
Highest possible size value of a allocation to be
logged.
TIP: Use this option if you want to
restrict the AMPolice from logging the allocs which big in size
over a certain value . We use this option to narrow our search for
leak detection.
-----------------------------------------------------------------------------------------
|
|
to stay with Parent process after the fork()
call
History: While testing one of our
application we were logging nothing just one line in the output
that application started. It was a strange feeling. The the
developer told us that we are having a fork call in startup and
this is the reason that AMPolice is not logging anything for us
..
TIP: if you want to debug parent then use
the option or else you will always be logging the child process
information.
------------------------------------------------------------------------------------------
|
|
To quit policing after "i" minutes
TIP: this is reverse of the begin
parameter. If i know that the leaks is visible is 1st 2 mins of my
start then why i want to stop the application from processing,
While starting the application i can say that AMPolice will stop
logging activity after 3 mins, then my application can continue
processing without any trouble.
-------------------------------------------------------------------------------------------
|
|
Random Sampling ( +- percentage )
-------------------------------------------------------------------------------------------
|
|
read options from a argument file.
TIP: Use this file option more
aggressively if you want to use default settings for large number
of applications.
-------------------------------------------------------------------------------------------
|
|
sample only once per n allocations.
History: while working with large scale
applications, we discovered that due to our effort we causing
performance issue on the application side. Idea behind this thought
is to reduce the effort on the AMPolice side. So if we monitor less
allocated memory we put less load on system.
Trade off : There is chance that finding a
leak will require some effort in report analysis stage.
TIP: Use this option when you have large
application to be monitored and you have good analysis
skills.
--------------------------------------------------------------------------------------
|
|
run AMPolice with thread safe option.
Very crucial for multi threaded
applications.
-------------------------------------------------------------------------------------
|
|
try and check the setup and exit.
TIP: Use this option if u are not sure
about your setting for AMPolice , this wont start the actual
application, it will just try to verify the settings if they are
possible or not.
-------------------------------------------------------------------------------------------
|
|
run in verbose mode
TIP: running AMPolice in verbose mode can
be very much annoying because output from application and AMPolice
can mix up and due to limitation of display settings important
information will lost.
-----------------------------------------------------------------------------------------
|
|
--exclude=e -x e expression you want to
avoid logs
Use a regular expression to avoid the information
getting into the logs for the specific regular expression.
|
|
--symbols=s -y s display function
backtrace symbols on:
x=exit, e=every, c=command, eg. -y xc
TIP: When ever you are trying to get the
feeling of the leak in initial runs you can avoid this parameter
and only when you are sure of leak use this option with other
tips.
|
|
--check=i -C i check for ampsignal commands
every so many allocation operation
e.g.
-C 0 default every 1 second
-C 1 , before doing any allocation operation
check for the signal ( high CPU load but very effective signaling
)
-C 100, after every 100 allocation check for the
signal command
TIP: Whenever you are trying to get the
feeling of the leak in initial runs you can use - C 1.
|
|
|
|