Skip to content

Improved memory usage and linux support#120

Open
diegobilski wants to merge 5 commits into
BurnP3:devfrom
diegobilski:dev
Open

Improved memory usage and linux support#120
diegobilski wants to merge 5 commits into
BurnP3:devfrom
diegobilski:dev

Conversation

@diegobilski

Copy link
Copy Markdown
  • Changes updateResampleFireIDsParquet to reduce memory usage and prevent file handle limit crash in Linux

  • Adds immediate parquet memory decay (necessary for Arrow 24.0+)

  • Conda-lock parallel environment for Linux

  • Removes unnecessary columns from LandscapeRasters datasheet

  • Schema update after removed columns

Removes Iteration and Timestep columns from LandscapeRasters datasheet
Schema update
Adds conda-lock environment for windows and linux
Updates conda env version
OS conditional PROJ reset
Schema update for LandscapeRasters removed columns
setting parameter for arrow 24.0
batch reading to avoid memory overload
removes large tables from memory after saving
change batch process to output a single file per tile/batch id
adding notes to detail changes

@shreeramsenthi shreeramsenthi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a couple questions about interoperability on Windows, but looks good for the most part! I think I'll separate out the schema changes for a later release since it's not mission critical and gives users more flexibility to roll back library versions until we roll out a single bigger change that requires a schema update.

Comment thread src/burnProbability.R
sharedDefinitionsPath <- paste0(ssimEnvironment()$PackageDirectory, "/shared.R")
return(sharedDefinitionsPath)
}
Sys.setenv("MALLOC_CONF" = "dirty_decay_ms:0,muzzy_decay_ms:0") # Disable jemalloc decay to free up memory immediately (Arrow 24.+. Must be done before loading Arrow)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a linux-specific change? If so maybe should have a conditional based on .Platform$OS.type ? If not, has it been tested on Win yet?

@diegobilski diegobilski Jul 10, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, when searching if this was linux specific, I found that jemalloc reached its end of life. Linux is not planning to remove it from future distributions, but future versions of arrow will likely start defaulting to mimalloc (which is the standard memory allocator used by arrow in Windows). It should be harmless to set this environment variable even if it's not used, but it would be worth testing this changes in Windows, and include a mimalloc parameter to replicate this behaviour in Windows and future Linux distributions:

# For the current jemalloc default
Sys.setenv("MALLOC_CONF" = "dirty_decay_ms:0,muzzy_decay_ms:0")

# For the future mimalloc default
Sys.setenv("MIMALLOC_PURGE_DELAY" = "0") 

Comment thread burnP3Plus_conda-lock.yml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this conda lock file work with Windows? Does SyncroSim provide a way to specify different conda files for Linux and Windows?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conda-lock contains parallel environments for Windows and Linux, but it's not handled by SyncroSim yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants