PSIM Script running out of memory

Gustavo Salgado_20678
Gustavo Salgado_20678 New Altair Community Member
edited February 27 in Community Q&A

I'm trying to run this simple script, the problem is that every simulation, the RAM usage increases until PSIM runs out of memory.

My computer has more than enough RAM to complete each simulation.

Is there a way to make the script flush the RAM once it's not needed? I don't need the simulation results on RAM, since it's saved to a file for processing in MATLAB.

Side question, when using ASimulate(), is there a way to limit concurrent simulations? I tried using a regular Simulate() every 11 ASimulate(), but after some time the program just closes itself without a given error.

Edit: It looks like the first problem is related to a memory leak fixed with PSIM 2023.0 . Unfortunately I don't have access to the 2023 versions (Student License)

Thank you in advance.

 

image

Tagged:

Answers

  • Rhonda_20369
    Rhonda_20369 New Altair Community Member
    edited February 5

    Please send your PSIM schematic and this script file to us.

     

    Sincerely,

    Rhonda

  • Gustavo Salgado_20678
    Gustavo Salgado_20678 New Altair Community Member
    edited February 5

    Please send your PSIM schematic and this script file to us.

     

    Sincerely,

    Rhonda

    Of course, files are attached. PSIM version is 2022.3 (Sudent version)

    Symptom is: after every simulation run, PSIM memory usage increases until it runs out of memory.

    Also found out that when trying to run the simulations with PsimCmd, the PsimCmd process does not return/close itself. This has been reported before and fixed in 2023.0, that don't have access as a student. Maybe the problems are related?

  • Rhonda_20369
    Rhonda_20369 New Altair Community Member
    edited February 7

    Hi, Gustavo,

    Using your script and PSIM schematic, I have tried to run only 5 iterations of Freq values and saw the amount of memory in use increased at each round.

    Due to the large number of iterations in your script, the memory occupied by PSIM would exceed your computer's capacity.

    This is an issue I have reported to our development team. The memory occupied by each iteration should be released when PSIM simulation is finished. But it seems not. 

    For sure the development team will investigate further and find a fix before our next release. At this moment, the schedule for next version release is not finalized.

    I will keep you posted.

     

    Sincerely,

    Rhonda

  • Juan Rosales_22328
    Juan Rosales_22328
    Altair Employee
    edited February 7

    Hello, Gustavo.

    Additionally, you could check this blog where we describe a workflow for design exploration and optimization.

    Best,

    Juan

  • Bobby_20458
    Bobby_20458
    Altair Employee
    edited February 27

    Of course, files are attached. PSIM version is 2022.3 (Sudent version)

    Symptom is: after every simulation run, PSIM memory usage increases until it runs out of memory.

    Also found out that when trying to run the simulations with PsimCmd, the PsimCmd process does not return/close itself. This has been reported before and fixed in 2023.0, that don't have access as a student. Maybe the problems are related?

    Dear Gustavo,

    Wait() function will wait for all ASimulate functions to finish. You can limit the number of threads this way. Following code runs 20 simulations at a time.

     

    freq = {2 4 6 ...};
    m = SizeOf(freq);
    n = 0;
    while(n<m)
    {
    injfreq = freq[n];
    res = "E:\Desktop\PFCA\" + n + ".mat";
    ASimulate("E:\Desktop\MainV2.psimsch", res);
    n++;
     
    if(n % 20 == 0)
    {
    Wait();
    }
    }