Skip to content

memtoc

0.1.1Package record

'Tictoc'-Style Memory Usage Tracking

0packages depend
308downloads / year
46.7%test coverage
13/13flavors OK

Overview

About

Provides simple start/stop memory tracking functions tic_mem() and toc_mem() that can be nested, inspired by the 'tictoc' package. Track RAM usage during code execution with support for logging, custom messages, nested tracking blocks, and parallel worker monitoring. Features continuous background polling to estimate peak memory usage across main process and workers. Integrates with the 'future' package ecosystem for automatic worker detection. Designed for monitoring memory consumption in parallel workflows.

Changes in 0.1.1

CRAN resubmission

  • Replaced commented-out help examples with small, executable examples and regenerated the documentation. Logging examples now run in ordinary checks.
  • Restored temporary checkpoints so background polling returns its samples; nested monitors use separate files, removed by toc_mem() or mem_clear().
  • Include start/end observations in the reported peak when polling is enabled.
  • Added regression tests for nested sampling, cleanup, and peak bounds.
  • Removed the inaccurate Windows system requirement and clarified sampling and temporary-file recovery limitations.

Pre-CRAN development history

The development labels below predate the initial CRAN submission (0.1.0).

memtoc 0.4.0

Show all changes in 0.1.1Hide the rest of the changes in 0.1.1

Additions

  • Added vignette.
  • Added NEWS.md changelog.
  • Package passes R CMD check with no errors or warnings.

memtoc 0.3.1

Bug Fixes

  • Fixed background monitor sample retrieval on Windows. The monitor now saves checkpoints on every sample and reads from the persistence file when the background process is terminated.
  • Fixed test script using unexported format_bytes() function.

memtoc 0.3.0

New Features

  • **Parallel worker monitoring**: New workers parameter in tic_mem() allows monitoring memory across parallel workers from the future package ecosystem.
  • workers = "auto": Automatically detect future workers and child processes
  • workers = "none": Only monitor the main R process
  • workers = "children": Monitor main process and all child processes
  • Integer vector: Explicit list of PIDs to monitor
  • **Per-worker statistics**: Results now include worker_stats data frame with peak memory usage for each monitored process.
  • **New function mem_parallel_info()**: Diagnostic function to check parallel backend status and detected workers before running a job.
  • Results now include n_workers field showing number of worker processes monitored.

memtoc 0.2.0

New Features

  • **Background polling**: New interval parameter in tic_mem() enables continuous memory sampling via a background R process. This captures true peak memory even for short-lived allocations.
  • **Memory trajectory**: Results now include a trajectory data frame with timestamped memory samples when background polling is enabled.
  • **System memory context**: Trajectory includes system-wide RAM usage (sys_total, sys_avail, sys_percent). Warnings are displayed when system RAM exceeds 80% or 95%.
  • **CPU time tracking**: Results include cpu_user and cpu_system fields showing CPU time consumed during the tracked interval.
  • **Crash recovery**: New mem_recover() function retrieves memory samples from a crashed R session using persisted checkpoint files.
  • **Capability detection**: New mem_capabilities() function checks which features are available on the current system.
  • **Diagnostics**: New mem_diagnose() function provides detailed troubleshooting when background polling is unavailable.

memtoc 0.1.0

Initial Release

  • Core tic_mem() / toc_mem() functions for start/stop memory tracking.
  • Nested tracking support with proper stack management.
  • Logging with mem_log(), mem_clearlog(), and mem_print_log().
  • Human-readable output with peak memory, current memory, and elapsed time.
  • Print method for result objects showing detailed breakdown.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 4.7 min · r-devel-windows-x86_64
Status changes
  • OK13 OKNow
  • OK6 OK2026-09-27
Advisories

none known

Documentation

In release 0.1.1
READMEYes · 337 wordsVignettesYes · 1 · staticNEWSYes · 67% structured · mentions 0.1.1Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
12 (1 internal)includes a package overview page
Examples that run
100%10 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

308
CRAN downloads in the past year
Rank #25,274 · ~1/day · ~26/mo
Daily download trend is not available in this view yet.
30830 days
30890 days
3081 year
Compare downloads with other packages →
Also on5 r2u

Repository

7Stars
0Forks
0Open issues
0Open PRs
0Releases
14Commits
1Commit identities
14 commits · Last activity 2025-12-17 · +40% stars, 30d · The default branch showed an older version (0.1.0) than CRAN on 2026-10-11
Responsiveness
not measured

Stars over time

2026-09-27 · 52026-10-15 · 7
PracticesBeta

5 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/jcoa05/memtoc on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Windows

CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
9 external dependencies (excludes base and recommended)

Installing memtoc adds 6 packages (3 with compiled code, 1.2 MB of source tarballs). Heaviest: cli 629 KB, processx 191 KB, ps 168 KB.

Depends (1)
R >= 4.1.0
Imports (3)
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.1 (2026)
Releases (1)
  • 0.1.1Latest
    2026-09-26 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-09-26
Total releases
1 / 1 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 4.1.0
Download size
46 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("memtoc")
Ocampo, J. (2026). memtoc: 'Tictoc'-Style Memory Usage Tracking (Version 0.1.1) [Computer software]. https://doi.org/10.32614/CRAN.package.memtoc

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for memtoc version 0.1.1 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy