Skip to content

library(sf) causes high memory commit #2517

Open
@arthurgailes

Description

@arthurgailes

Describe the bug
library(sf) causes a high commit memory even with low usage. Furthermore, this seems to matriculate to individual cores in parallel (future) workers

To Reproduce
I start with a fresh installation of R 4.4.3 (I have also confirmed this in 4.3.1 and 4.3.3). The issue does not occur in 4.2.1. I then install sf

Additional context
Confirmed on Windows 10,11, and server 2016. sf version 1.0-20 and 1.0-19.

Image

Edit: adding the reprex of the issue.
Edit 2: clarify that library(sf) also triggers memory commit.

library(ps)

library(sf)
#> Linking to GEOS 3.11.2, GDAL 3.8.2, PROJ 9.3.1; sf_use_s2() is TRUE

mem_info <- ps::ps_memory_info()

bytes <- as.numeric(mem_info)
mem_df <- data.frame(
  metric = names(mem_info),
  bytes = bytes,
  GB = round(bytes / 1024^3, 2),
  stringsAsFactors = FALSE
)

mem_df
#>                 metric      bytes   GB
#> 1      num_page_faults      46373 0.00
#> 2            peak_wset  156405760 0.15
#> 3                 wset  156405760 0.15
#> 4      peak_paged_pool     773592 0.00
#> 5           paged_pool     556296 0.00
#> 6  peak_non_paged_pool      28200 0.00
#> 7       non_paged_pool      23672 0.00
#> 8             pagefile 2323931136 2.16
#> 9        peak_pagefile 2323931136 2.16
#> 10         mem_private 2323931136 2.16
#> 11                 rss  156405760 0.15
#> 12                 vms 2323931136 2.16

Created on 2025-04-08 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions