Maya 8.5 polyEditUV memory usage

Maya 8.5 polyEditUV memory usage

Anonymous
Not applicable
450 Views
3 Replies
Message 1 of 4

Maya 8.5 polyEditUV memory usage

Anonymous
Not applicable
I'm having problems with an apparent memory leak when using the polyEditUV command.
Here's a quick reproducer:

In a new scene run the following mel script:


$mySphere = `polySphere -r 1 -sx 50 -sy 50 -ch 0`;
select ($mySphere + ".map
  • ");
    for($i=0; $i<100000; ++$i)
    polyEditUV -u 0.0 -v 0.0;


  • On my machine doing the above sends Maya's memory usage through the roof.

    Things that don't free up the memory:
    Deleting history
    Flushing the undo buffer
    Deleting the object in question

    Things that do free up the memory:
    Unloading the scene
    Minimizing and restoring the application window

    After minimize/restore: running the above script again in the same scene doesn't result in huge memory usage; running it again in a new scene does.

    Can anyone else reproduce this problem? Does anyone know a solution?
    0 Likes
    451 Views
    3 Replies
    Replies (3)
    Message 2 of 4

    Anonymous
    Not applicable
    Oh wow, it's definitely reproducible for me in Maya 8 (I get exactly the same thing).

    I can't really think of any way to fix that off the top of my head, you might want to report it to Autodesk as a bug or something. I've got a few Mel scripts that are eating up gigs of memory for no good reason, so I might be having a similar issue with them without realizing. I'll have a bit of a play around with those scripts and see if I come up with anything.
    0 Likes
    Message 3 of 4

    Anonymous
    Not applicable
    Hmmm.... The plot thickens!

    I think it is still Undo related, because if I try it with:

     
    $mySphere = `polySphere -r 1 -sx 50 -sy 50 -ch 0`;
    select ($mySphere + ".map
  • ");
    for($i=0; $i<50000; ++$i)
    {
    polyEditUV -u 0 -v 0 ;
    flushUndo;
    }


  • I.e, just flushing the Undo inside the loop (dodgy as that is), seems to work for me. I'm guessing that there is something really really evil going on here, like that command doesn't check the Undo settings to see how many Undo levels to store, or if Undo is turned off, and it just banks them up, and that maybe when you minimize the app, there is code that checks Undo there.

    The reason I would guess at that is that I have 200 levels of undo turned on usually, and each time I move any number of UVs with Undos enabled I lose 20-100k of memory (which I can generally get back by flushing). So regardless of the size of that loop, I should only ever be building up 200 * 100k, or ~20 mbs worth of memory in Undos, but instead it just keeps going until it runs out. Unless I'm missing something here, which is quite possible as I'm a Maya/Mel noob 🙂

    Nasty.
    0 Likes
    Message 4 of 4

    Anonymous
    Not applicable
    Gah! Seems that flushUndo doesn't actually always clean up the problem in some of the cases where minimizing does!
    The flushUndo trick worked in the situation I was testing above, but working it into my scripts, they still eat 1.5 gbs of memory, and 90% of that memory gets freed if you I do a minimize (including some of the VM).

    So the flushUndo in the loop thing may not help you at all, but may work in some circumstances.

    Sorry about that!
    0 Likes