Memory dog for Autodesk Maya

Source: Internet
Author: User
Start

Maya has been criticized since it was acquired by Autodesk. The specific manifestation is that it is particularly easy to crash: it is easy to crash in large operation scenarios. When it comes to poor RP, you still don't discuss it. But why is this happening?

Cheng

Anyone who has taken computer-related courses (not from a land expert like me) knows,ProgramStatic, heap, and stack memory areas ). Static and stack have little to do with us, and heap is a huge source of problems. In general, data-intensive software, from Oracle to zbrush, all need to perform their own memory management. That type of Delete in the East, New West, is definitely not good for robust and stable commercial software. Unfortunately, 3dsmax does not have memory management, so we should try to switch to 64bit. Any program has a heap capacity that can be allocated. This capacity mainly depends on the operating system, that is, whether you use a 32-bit OS or a 64-bit OS. It is impossible for someone to install 64-bit OS on a 64-bit CPU, so the idea of "Can I install 64-bit Maya on my 32-bit CPU" can be stopped. For 64-bit Vista, the maximum heap capacity of each process is 6 GB. Do not argue with me that 64 bit is equal to the 64 power of 2 or how much Pb of memory can be allocated, which is not investigated. 6G is the maximum capacity that the compiler can give you, and the maximum acceptable capacity of your pointer is 1g, no matter whether you use a 64bit pointer or not, that is to say, char * P = new char [0x40000000] is executed six times in a row, and the process is finished. Therefore, for the 32bit Maya, which is currently widely used, it can use up to GB of memory, no matter how much memory you add. This is the ideal situation. It doesn't mean that you can allocate a large volume. If you load a Gbps model, Maya basically goes down. The model size is not. ma or. the size of MB is the size of the data, that is, the geometric data of vertex, normal, and UV plus the numerical data of the index topology. One fp32 occupies 4 bytes, an unsigned short occupies 2 bytes.

In addition, it is necessary to eliminate the illusion that the memory usage of a process can be detected through the functions provided by the OS. The globalmemorystatusex function cannot be used to obtain the maximum number of memories that can be allocated currently. You can use simulated memory fragments to implement this function. It only displays external conditions, but the total memory occupied by a program is irrelevant to the current memory structure of the program.

Transfer

Fortunately, Maya is also self-aware and provides a Mel command memory to output memory statistics. As a result, I wrote a simple Mel command to output the memory status and output when the node is deleted or created.CodeIn/Files/jedimaster/memdog.rarDownload it. It's very easy.

End

I personally think that software based on DAG nodes, including Autodesk Maya, sidefx Houdini, and Apple shake, are easy to crash because they have to sacrifice centralized memory management to achieve internal node connections, after a long running, memory fragments are extremely high. In addition, Windows is basically the world of Visual C ++. How can Microsoft upgrade its msvcr and msvcp C \ c ++ runtime libraries, the OS has limits. The maximum memory capacity that heap can allocate depends on the size of the maximum idle segment. It is said that Linux is much better, and I have no conditions to test it. After a few days I bought a new computer and installed another Ubuntu to run and run, the notebook is really uncomfortable. Here is where the exception is thrown. test checks whether the pointer is 0x100. If yes, it will be wrong ~ So I hung up. In this place, we hope that Autodesk people can see it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.