We are currently running some long-running scripts, and are having problems with memory usage.

Upon analysing where the memory was used, it became apparent that the static variables of loadCropRelations was causing the problems.

We do not want to clear all static variables between certain parts of the script, but instead wants to just clear the static variables of loadCropRelations. However, the naming of the static variables makes it nigh on impossible to clear them.

I propose that the function creates a single static variable as an array, and instead uses it as a datastructure to store the data in, instead of creating new static variables for each variation of the function.

This would make it possible for us to clear just the static variable of that function.

CommentFileSizeAuthor
#2 static_cache_variable-2665260-2.patch1.44 KBmian3010

Comments

mian3010 created an issue. See original summary.

mian3010’s picture

StatusFileSize
new1.44 KB

Attached proposed solution

kristougher’s picture

Status: Active » Fixed

Good point. Merged into Crop Instance.

  • mian3010 authored 50325cc on 7.x-1.x
    Issue #2665260 by mian3010: Static cache variable names makes it hard to...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.