Vasily Gerasimov 1eb755fbca Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2. 3 years ago
..
ut e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
README.md b23c1d7a80 Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2. 3 years ago
actor.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
actor.h 1eb755fbca Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2. 3 years ago
actor_bootstrapped.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
actor_coroutine.cpp 330c83f8c1 Restoring authorship annotation for Alexey Borzenkov <snaury@yandex-team.ru>. Commit 2 of 2. 3 years ago
actor_coroutine.h 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
actor_coroutine_ut.cpp 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
actor_ut.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
actorid.cpp 2e714b5ebd Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2. 3 years ago
actorid.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
actorsystem.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
actorsystem.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
actorsystem_ut.cpp 2e714b5ebd Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2. 3 years ago
ask.cpp 2e714b5ebd Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2. 3 years ago
ask.h 2e714b5ebd Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2. 3 years ago
ask_ut.cpp 60040c91ff Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 2 of 2. 3 years ago
balancer.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
balancer.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
balancer_ut.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
buffer.cpp 0f4c5d1e8c Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 2 of 2. 3 years ago
buffer.h 0f4c5d1e8c Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 2 of 2. 3 years ago
callstack.cpp 6238988d0c Restoring authorship annotation for <spuchin@yandex-team.ru>. Commit 2 of 2. 3 years ago
callstack.h 6aced6c854 Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 2 of 2. 3 years ago
config.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
cpu_manager.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
cpu_manager.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
cpu_state.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
defs.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
event.cpp 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
event.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
event_load.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
event_local.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
event_pb.cpp 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
event_pb.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
event_pb_payload_ut.cpp 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
event_pb_ut.cpp 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
events.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
events_undelivered.cpp 330c83f8c1 Restoring authorship annotation for Alexey Borzenkov <snaury@yandex-team.ru>. Commit 2 of 2. 3 years ago
executelater.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_base.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_base.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_basic.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_basic.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_basic_ut.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_io.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_io.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_united.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_united.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_pool_united_ut.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
executor_thread.cpp 1eb755fbca Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2. 3 years ago
executor_thread.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
hfunc.h 0a579de32b Restoring authorship annotation for <ienkovich@yandex-team.ru>. Commit 2 of 2. 3 years ago
interconnect.cpp 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
interconnect.h 0f4c5d1e8c Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 2 of 2. 3 years ago
invoke.h 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
io_dispatcher.cpp 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
io_dispatcher.h 667a4ee7da Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2. 3 years ago
lease.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
log.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
log.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
log_iface.h d3a398281c Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2. 3 years ago
log_settings.cpp 6aced6c854 Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 2 of 2. 3 years ago
log_settings.h 0a579de32b Restoring authorship annotation for <ienkovich@yandex-team.ru>. Commit 2 of 2. 3 years ago
log_ut.cpp 2e714b5ebd Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2. 3 years ago
mailbox.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
mailbox.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
mailbox_queue_revolving.h bd5ef432f5 Restoring authorship annotation for <agorodilov@yandex-team.ru>. Commit 2 of 2. 3 years ago
mailbox_queue_simple.h bd085aee9b Restoring authorship annotation for <eeight@yandex-team.ru>. Commit 2 of 2. 3 years ago
memory_track.cpp b23c1d7a80 Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2. 3 years ago
memory_track.h b23c1d7a80 Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2. 3 years ago
memory_tracker.cpp b23c1d7a80 Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2. 3 years ago
memory_tracker.h b23c1d7a80 Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2. 3 years ago
memory_tracker_ut.cpp b23c1d7a80 Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2. 3 years ago
mon.h 2909866fbc Restoring authorship annotation for <agri@yandex-team.ru>. Commit 2 of 2. 3 years ago
mon_stats.h 1eb755fbca Restoring authorship annotation for Vasily Gerasimov <UgnineSirdis@gmail.com>. Commit 2 of 2. 3 years ago
monotonic.cpp 330c83f8c1 Restoring authorship annotation for Alexey Borzenkov <snaury@yandex-team.ru>. Commit 2 of 2. 3 years ago
monotonic.h 330c83f8c1 Restoring authorship annotation for Alexey Borzenkov <snaury@yandex-team.ru>. Commit 2 of 2. 3 years ago
probes.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
probes.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
process_stats.cpp fccc62e9bf Restoring authorship annotation for Alexander Gololobov <davenger@yandex-team.com>. Commit 2 of 2. 3 years ago
process_stats.h fccc62e9bf Restoring authorship annotation for Alexander Gololobov <davenger@yandex-team.com>. Commit 2 of 2. 3 years ago
scheduler_actor.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
scheduler_actor.h 330c83f8c1 Restoring authorship annotation for Alexey Borzenkov <snaury@yandex-team.ru>. Commit 2 of 2. 3 years ago
scheduler_actor_ut.cpp 2e714b5ebd Restoring authorship annotation for Sergey Polovko <sergey@polovko.me>. Commit 2 of 2. 3 years ago
scheduler_basic.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
scheduler_basic.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
scheduler_cookie.cpp dc5feacd15 Restoring authorship annotation for Vitalii Gridnev <gridnevvvit@gmail.com>. Commit 2 of 2. 3 years ago
scheduler_cookie.h 6aced6c854 Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 2 of 2. 3 years ago
scheduler_queue.h 6aced6c854 Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 2 of 2. 3 years ago
servicemap.h 6aced6c854 Restoring authorship annotation for Cthulhu <cthulhu@yandex-team.ru>. Commit 2 of 2. 3 years ago
worker_context.cpp e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
worker_context.h e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago
ya.make e5d4696304 Restoring authorship annotation for <serxa@yandex-team.ru>. Commit 2 of 2. 3 years ago

README.md

Memory tracker

https://a.yandex-team.ru/arc/trunk/arcadia/library/cpp/actors/core/memory_track.h

Использование:

  • отслеживание аллокаций экземпляров конкретного класса через new/delete и new[]/delete[]
  • отслеживание аллокаций в контейнерах
  • ручное отслеживание моментов аллокации/деаллокации

Отслеживание аллокаций класса через new/delete

Использование с автоматически генерируемой меткой:

#include <library/cpp/actors/core/memory_track.h>

struct TTypeLabeled
    : public NActors::NMemory::TTrack<TTypeLabeled>
{
    char payload[16];
};

Использование с пользовательским именем метки:

#include <library/cpp/actors/core/memory_track.h>

static const char NamedLabel[] = "NamedLabel";

struct TNameLabeled
    : public NActors::NMemory::TTrack<TNameLabeled, NamedLabel>
{
    char payload[32];
};

Отслеживание аллокаций в контейнерах

#include <library/cpp/actors/core/memory_track.h>

static const char InContainerLabel[] = "InContainerLabel";

struct TInContainer {
    char payload[16];
};

std::vector<TInContainer, NActors::NMemory::TAlloc<TInContainer>> vecT;

std::vector<TInContainer, NActors::NMemory::TAlloc<TInContainer, InContainerLabel>> vecN;

using TKey = int;

std::map<TKey, TInContainer, std::less<TKey>,
    NActors::NMemory::TAlloc<std::pair<const TKey, TInContainer>>> mapT;

std::map<TKey, TInContainer, std::less<TKey>,
    NActors::NMemory::TAlloc<std::pair<const TKey, TInContainer>, InContainerLabel>> mapN;

std::unordered_map<TKey, TInContainer, std::hash<TKey>, std::equal_to<TKey>,
    NActors::NMemory::TAlloc<std::pair<const TKey, TInContainer>>> umapT;

std::unordered_map<TKey, TInContainer, std::hash<TKey>, std::equal_to<TKey>,
    NActors::NMemory::TAlloc<std::pair<const TKey, TInContainer>, InContainerLabel>> umapN;

Ручное отслеживание аллокаций/деаллокаций

#include <library/cpp/actors/core/memory_track.h>

static const char ManualLabel[] = "ManualLabel";

...
NActors::NMemory::TLabel<ManualLabel>::Add(size);

...
NActors::NMemory::TLabel<ManualLabel>::Sub(size);

Собираемые метрики

Сервис utils, пользовательская метка label, сенсоры:

  • MT/Count: количество аллокаций в моменте
  • MT/Memory: аллоцированная память в моменте
  • MT/PeakCount: пиковое значение количества аллокаций (сэмплится с фиксированной частотой)
  • MT/PeakMemory: пиковое значение аллоцированной памяти