[Closed] Memory Leaks
If you guys find any memory leaks, could you please tell me? I’m currently in the hunt in fixing memory leaks, and any advance word would be highly appreciated by myself.
Now before you hit your send button, please be aware that for Max 2008 tremendous work was done to fix leaks (Of all sorts). Not just memory leaks, but other low lying memory issues. This is something you will not find on any marketing document, but it was done all the same. In my opinion, this release of 3dsmax is worth it just for cleanup in memory usage. In fact I highly recommend that if you have instability in 3dsmax 9.x that you upgrade to max 2008. I know that you will find it more stable in this regard. I won’t give any statistics (Not now at least) now as to how much was fixed, but the numbers were really good.
Now keep in mind that 3DSMax is a massive product and I’m sure there are more leaks out there. And I would love to get your help to fix them. So if you have a situation where your production runs mysteriously fail after 4 hours, or where you have a rendering that fails mysteriously after 3 hours, or something like that: Then contact me, oooooorrrr, log a bug on the official autodesk website. That is a guaraunteed way to land a bug on my desk.
Thanks for your enthusiasm guys for making the maxscript community such a great one.
Chris Johnson
It would be pretty hard to create memory leaks in maxscript, I believe. the only type of code you will ever have to worry about memory leaks with would be in C.
int const blah blah
and then not deconstructing when you are supposed to. However in maxscript I think there are hardcoded handlers for this, since maxscript is only a upper level code its not doing anything incredibly hardcore like machine code.
Well, I didn’t necassarily state I was looking for maxscript specific leaks, however I can see where the misunderstanding would come from. Maxscript has its own memory management using garbage collection which works pretty well.
I just asked on this forum, because the people here are little more technical, and thus I may get some better reports than just simple hand waving.
I recently created a sample file, along with a loop script, as a mem leak example, and sent it to Sparks, since we’re not able to do much of batching with our files. Can’t post the file here, but I could describe it:
The sample file had :
- approx 2500 frames
- 6 bipeds, all animated.
- 6 skin meshes (only face mesh of all 6 characters – no body mesh), approx 575 polys per
mesh - Some additional bones per character, that skinned the face mesh (approx 8 per character)
- No textures/custom shaders at all, just one flat standard default material applied to
everything in scene. - 18 cameras, with approx 6 keyframes on each.
- File size of 87 MB (clearing off all animation brings it to something around 32 MB)
The loop batch that I ran for the test was absolutely simple :
1) load the file, and then
2) reset max.
3) Print mem stats ( using sysinfo.getMAXMemoryInfo() )
Surprisingly, the loop could run only for 8-9 times in Max 8, and 12-13 times in Max 9, before max bailed out because of mem shoot up. And I dont suppose it is because of the line
sysinfo.getMAXMemoryInfo() , coz the result is the same even without it
Here’s a copy of what I print out onto the listener :
“========================================”
Mem Info after Max Reset 1 times :
Page Fault Count: 151596
Peak Working Set Size: 444.961 MB
Working Set Size: 294.18 MB
Quota Peak Paged Pool Usage: 0.636539 MB
Quota Paged Pool Usage: 0.469669 MB
Quota Peak NonPaged Pool Usage: 0.0369568 MB
Quota NonPaged Pool Usage: 0.036293 MB
Pagefile Usage: 315.582 MB
Peak Pagefile Usage: 395.0 MB
“========================================
“
“========================================”
Mem Info after Max Reset 2 times :
Page Fault Count: 225949
Peak Working Set Size: 563.309 MB
Working Set Size: 413.359 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.039978 MB
Quota NonPaged Pool Usage: 0.0394211 MB
Pagefile Usage: 435.293 MB
Peak Pagefile Usage: 512.301 MB
“========================================
“
“========================================”
Mem Info after Max Reset 3 times :
Page Fault Count: 300371
Peak Working Set Size: 681.406 MB
Working Set Size: 532.035 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.0430679 MB
Quota NonPaged Pool Usage: 0.0424728 MB
Pagefile Usage: 554.387 MB
Peak Pagefile Usage: 630.836 MB
“========================================
“
“========================================”
Mem Info after Max Reset 4 times :
Page Fault Count: 374660
Peak Working Set Size: 799.906 MB
Working Set Size: 651.043 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.0460815 MB
Quota NonPaged Pool Usage: 0.0455246 MB
Pagefile Usage: 673.75 MB
Peak Pagefile Usage: 749.43 MB
“========================================
“
“========================================”
Mem Info after Max Reset 5 times :
Page Fault Count: 448686
Peak Working Set Size: 917.895 MB
Working Set Size: 769.543 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.0491714 MB
Quota NonPaged Pool Usage: 0.0486145 MB
Pagefile Usage: 792.594 MB
Peak Pagefile Usage: 868.008 MB
“========================================
“
“========================================”
Mem Info after Max Reset 6 times :
Page Fault Count: 522805
Peak Working Set Size: 1036.16 MB
Working Set Size: 888.281 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.0522614 MB
Quota NonPaged Pool Usage: 0.0517044 MB
Pagefile Usage: 911.797 MB
Peak Pagefile Usage: 986.699 MB
“========================================
“
“========================================”
Mem Info after Max Reset 7 times :
Page Fault Count: 596805
Peak Working Set Size: 1154.55 MB
Working Set Size: 1007.04 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.0553131 MB
Quota NonPaged Pool Usage: 0.054718 MB
Pagefile Usage: 1030.92 MB
Peak Pagefile Usage: 1105.22 MB
“========================================
“
“========================================”
Mem Info after Max Reset 8 times :
Page Fault Count: 670561
Peak Working Set Size: 1272.77 MB
Working Set Size: 1126.0 MB
Quota Peak Paged Pool Usage: 0.636883 MB
Quota Paged Pool Usage: 0.469547 MB
Quota Peak NonPaged Pool Usage: 0.058403 MB
Quota NonPaged Pool Usage: 0.0578461 MB
Pagefile Usage: 1150.34 MB
Peak Pagefile Usage: 1223.89 MB
“========================================
“
If the user asks max to reset, he means just get rid of all junk, he’d like to start fresh.
Wish max thought so too
Thanks for starting this thread.
cheers
shibu
well if I come across anything thats not already been pointed out I will let you know