apache/hadoop · error

failed to allocate memory for stopwatch

Error message

failed to allocate memory for stopwatch

What it means

Error "failed to allocate memory for stopwatch " thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfs-tests/vecsum.c:87

    t *= tb.numer;
    t /= tb.denom;
    ts->tv_sec = t / 1000000000ULL;
    ts->tv_nsec = t - (ts->tv_sec * 1000000000ULL);
    return 0;
}
#else
static int clock_gettime_mono(struct timespec * ts) {
    return clock_gettime(CLOCK_MONOTONIC, ts);
}
#endif

static struct stopwatch *stopwatch_create(void)
{
    struct stopwatch *watch;

    watch = calloc(1, sizeof(struct stopwatch));
    if (!watch) {
        fprintf(stderr, "failed to allocate memory for stopwatch\n");
        goto error;
    }
    if (clock_gettime_mono(&watch->start)) {
        int err = errno;
        fprintf(stderr, "clock_gettime(CLOCK_MONOTONIC) failed with "
            "error %d (%s)\n", err, strerror(err));
        goto error;
    }
    return watch;

error:
    free(watch);
    return NULL;
}

static void stopwatch_stop(struct stopwatch *watch,
        long long bytes_read)
{

View on GitHub (pinned to 2add963021)

Solutions

  1. Free memory or run vecsum on a host with sufficient RAM; the stopwatch struct is tiny, so this indicates severe memory pressure.
  2. Check for earlier leaks in the process that consumed available memory.

When it happens

Trigger: Allocation of the stopwatch structure failed in vecsum setup.

Common situations: Extremely low available memory when launching the vecsum benchmark binary.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/7dd53b3b8609939a. Report an issue: GitHub.