LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Permutations using perms in MathScript throws Memory is full error

Solved!
Go to solution

I'm using the perms Mathscript function to find possible permutations of single digit numbers in an array.  According to the perms function help it will accept 15 elements or fewer.  I can feed this function up to 9 elements but when I try 10 I get the error - LabVIEW:  Memory is full.  I've increased the Virtual Memory per the suggestion in the Why do I get "Memory is Full" Error KB

 

The error occurs when Windows Task manager reaches 628 M no matter what I change my Virtual Memory to.  I do have 2 GB of RAM in my computer.  Any suggestions?

 

Thanks,

Message Edited by CactusCoder on 11-14-2008 11:02 PM
Message Edited by CactusCoder on 11-14-2008 11:04 PM
0 Kudos
Message 1 of 2
(2,438 Views)
Solution
Accepted by Doug_Kunz

This is expected. With N=10, the final matrix will be 10!x10, or about 36Million elements of DBL. Each contains 8 bytes, bringing the footprint to ~290MB for a single copy of the expected output matrix.

 

Looking at the memory use of the VI for N=9, it is already 100MB, so it looks like there are about 4 copies of the final array in memory. No wonder N=10 is impossible.

 

I would recommend to implements this in plain LabVIEW (wires and loops) with a U8 datatype, you'll probably be able to go higher than 9.

 

Don't forget that 15 is unrealistic, because the array dimensions are I32, but the array size will be N!. This means you don't have enough rows for e.g. N>12 anyway.

 

Do you have a good reason that you need such huge arrays?

Message 2 of 2
(2,425 Views)