Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set heap limit for v8 #160

Open
nbars opened this issue Apr 5, 2024 · 3 comments
Open

Allow to set heap limit for v8 #160

nbars opened this issue Apr 5, 2024 · 3 comments
Assignees

Comments

@nbars
Copy link

nbars commented Apr 5, 2024

Hey,

Thanks for this great project! I am running into out-of-memory errors when plotting complex plots via Altair, and I guess that should be fixable by bumping the heap limit of the v8 engine. Would it be sufficient to add something like this

let options = WorkerOptions {
    extensions: vec![
        vl_convert_text_runtime::init_ops(),
        vl_convert_converter_runtime::init_ops(),
    ],
    module_loader: module_loader.clone(),
    ..Default::default(),
    BootstrapOptions {
        args: fillFromEvnVarOrUseDefaults(), // set, e.g., --max-old-space-size=131072,--max-heap-size=131072
         ..Default::default(),
    }
};

here

let options = WorkerOptions {
extensions: vec![
vl_convert_text_runtime::init_ops(),
vl_convert_converter_runtime::init_ops(),
],
module_loader: module_loader.clone(),
..Default::default()
};

Or is there a better place to start?

Best,
Nils

@jonmmease
Copy link
Collaborator

Hi @nbars, thanks for the kind words! Making the v8 heap configurable would be great. I haven't looked into this, so you probably know more about this than I do right now. Do you want to try making a PR?

As an aside, if your charts include aggregations then it may help to enable the VegaFusion data transformer. When this is enabled, data transformations (like filtering and aggregation) will be applied in Python before the data is sent to the vl-convert. For charts without aggregations, it will also remove unused columns which can also reduce memory usage.

But even if this helps, it would still be great to have the v8 configuration option exposed.

@nbars
Copy link
Author

nbars commented Apr 5, 2024

Hi @jonmmease, thanks for the swift response. Using VegaFusion works like a charm! I am happy to make a PR. Is it possible to assign me to the issue so that it is added to my "GitHub todo list"?

@jonmmease
Copy link
Collaborator

Glad that worked! Yes, I just assigned to you. Thanks!

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

No branches or pull requests

2 participants