Skip to content

Commit

Permalink
README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Sep 18, 2024
1 parent d1a591b commit 5a048f7
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Pharo version](https://img.shields.io/badge/Pharo-13-%23aac9ff.svg)](https://pharo.org/download)


Illimani is a library of memory profilers. It provides an - allocation site memory profiler, - a object lifetimes profiler, - and an allocation rate profiler. The allocation site profiler gives you information about the allocation sites and where the objects where produced in your application. The object lifetimes profiler gives you information about how much time did the objects lived, and about how many GC cycles (both scavenges and full GC) they survived.
Illimani is a memory profiler. It gives you information about the allocation sites and where the objects where produced in your application. It also gives you information about object lifetimes, how much time did the objects lived, and about how many GC cycles (both scavenges and full GC) they survived.

## How to install it

Expand Down Expand Up @@ -36,20 +36,20 @@ profiler
yourself
```

Example 1, allocation profiler for profiling the Pharo IDE activity
Example 1, Profiling the Pharo IDE activity

```st
IllAllocationSiteProfiler new
IllMemoryProfiler new
copyExecutionStack;
profileFor: 6 seconds;
open;
yourself
```

Example 2, object lifetimes profiler on a code snippet:
Example 2, Profiling on a code snippet:

```st
IllObjectLifetimesProfiler new
IllMemoryProfiler new
profileOn: [ 15 timesRepeat: [ StPlaygroundPresenter open close ] ] ;
open;
yourself
Expand All @@ -62,6 +62,7 @@ IllObjectLifetimesProfiler new
You can decide both to profile a given method block or just watching the activity of the image for some time.

```st
profiler := IllMemoryProfiler new.
"With this the profiler will block the ui and you will only capture the objects created by your code snippet"
profiler profileOn: [ anObject performSomeAction ].
Expand All @@ -88,7 +89,7 @@ profiler open.

### Sample the allocations

By default, the profiler captures 1% of the allocations. We chose this number because in our experiments we found out that the profiler producess precise results with minimal overhead with that sampling rate. You can change the sampling rate. The sampling rate needs to be a fraction.
By default, the profiler captures 1% of the allocations. We chose this number because in our experiments we found out that the profiler producess precise results with minimal overhead with that sampling rate. You can change the sampling rate. Attention, the sampling rate needs to be a fraction.

```st
"Capture 10% of the allocations"
Expand All @@ -110,26 +111,26 @@ This will create a csv file with all the information about the allocated objects

### Monitor the GC activity

You can monitor the GC activity while the profiler is profiling with the message `monitorGCActivity`. This will fork a process that will take GC statistics once per second. Then, when exporting the profiler data, two csv files will be exported containing both the scavenges and full GCs. By default, the GC monitoring is disabled.
You can monitor the GC activity while the profiler is profiling with the message `monitorGCActivity`. This will fork a process that will take GC statistics once per second. Then, when exporting the profiler data, two csv files will be exported containing both the scavenges and full GCs. By default, the GC monitoring is disabled. You can enable the GC monitor with the message:

```st
profiler monitorGCActivity
```

## Implement your own memory profiler

Illimani is also a profiling framework. A user can implement his own profiler by subclassing the `IllAbstractProfiler` class and defining the few missing methods. Especially, the `internalRegisterAllocation:` method. The `internalRegisterAllocation:` method will be called each time that an allocation is produced (or when sampling, each time that the sampling rates matches) with the newly allocated object as a parameter. You can the `IllAllocationRateProfiler` class as an example of a very simple memory profiler.
Illimani is also a profiling framework. A user can implement his own profiler by subclassing the `IllAbstractProfiler` class and defining the few missing methods. Especially, the `internalRegisterAllocation:` method. The `internalRegisterAllocation:` method will be called each time that an allocation is produced (or when sampling, each time that the sampling rates matches) with the newly allocated object as a parameter. You can the `IllAllocationRateProfiler` class as an example of a simple memory profiler.

## Allocation Site profiler
## Statistics

![allo](https://github.com/jordanmontt/illimani-memory-profiler/assets/33934979/c83ab37b-3ec3-4f19-b4de-02110cd837af)

Without the UI, because the profiler is independent from the UI, you can access to some statistics. See the protocol `accessing - statistics` in the profiler to see the methods. Also, the profiler has a statistics model that groups and sorts the allocation by class and by methods. For example check 'profiler stats allocationsByClass.'
Without the UI, because the profiler is independent from the UI, you can access to some statistics. See the protocol `accessing - statistics` in the profiler to see the methods. Also, the profiler has a statistics model that groups and sorts the allocation by class and by methods.

## Object lifetimes profiler
## A glance at the UI

![fina](https://github.com/jordanmontt/illimani-memory-profiler/assets/33934979/e0c3cf6e-5105-45dc-84ba-26a5513a6710)

![allo](https://github.com/jordanmontt/illimani-memory-profiler/assets/33934979/c83ab37b-3ec3-4f19-b4de-02110cd837af)

## Related papers

- [ILLIMANI Memory Profiler - A Technical Report. Jordan Montaño S., Polito G., Ducasse S., Tesone P. 2023. Technical Report.](https://hal.science/hal-04225251/file/conference_101719.pdf)
Expand Down

0 comments on commit 5a048f7

Please sign in to comment.