首页 > 解决方案 > 为 Ignite Compute Grid 设置 RAM 大小

问题描述

我需要使用 Ignite Compute Grid 来执行大量 RAM 的并行计算。因此,我需要将每个 ignite 节点的可用 RAM 设置为 4GB 以上。

但是,我找不到如何设置它。

示例:我ProcessIdentifier.getProcessID(i)在以下代码中的方法需要最多 4GB 的 RAM 才能正确执行并返回一个String对象。

public static void main(String[] args) {
    Ignite ignite = Ignition.start();
    IgniteCompute compute = ignite.compute();

    Collection<IgniteCallable<String>> calls = new ArrayList<>();
    for (int i = 0; i<100; i++) {
        ProcessIdentifier pi = new ProcessIdentifier(i);
        calls.add(pi::getProcessID);
    }
    //sends the computation of the 100 pi.ProcessIdentifier(i) to the cluster nodes
    Collection<String> res = ignite.compute().call(calls);

    //print the results
    String total = res.toString(); 
    System.out.printf(total);
}

谁能帮我弄清楚?

标签: javaramignite

解决方案


如果您不想在 Ignite 缓存中存储任何内容并仅使用 Compute API,那么只需增加 JVM 堆就足够了。要增加它,您可以在 java 进程开始使用 -Xmx 参数时修改 ignite.sh 脚本中的行。


推荐阅读