Rebar creation performance and memory usage

Rebar creation performance and memory usage

Anonymous
Not applicable
743 Views
2 Replies
Message 1 of 3

Rebar creation performance and memory usage

Anonymous
Not applicable

Hi all, I am creating a box girder bridge. The box girder is about 50 meters long and has a bit complex geometry shape which I created using DirectShape. I need to create about 2000 rebars for the girder. The problem is that if I use the 50 meters long girder as the host element for the rebars, the creation time is very long (about 45 minutes), and the memory (RAM) used is about 31 GB which is very close to hardware RAM limit of my computer (32 GB), and often Revit just crashes. If I use a small part of the girder (1 meter long) as the host element, the rebar creation time is about only 5 minutes and the RAM used is about 11 GB. However, a lot of longitudinal rebars span about 50 meters, and I can not divide them into small segements.

 

Even when I use 1 meter girder as the host element, if I add 2000 more rebars, the total creation time (for 4000 rebars) becomes 35 minutes and the RAM usage is about 13 GB. My code creates all these rebars in a loop. I output the creation time of each rebar to a text file and found that the creation time becomes longer and longer for similar rebars as the loop goes on.

 

Please give me some suggestions. Is this related to the garbage collection? Do I have to manually do the garbage collection in my code?

0 Likes
744 Views
2 Replies
Replies (2)
Message 2 of 3

recepagah12
Advocate
Advocate

No one can say a certain thing without looking at the source code.

You said when creating the rebars each created rebar took more time before others. There is a possibility, you create more than one rebar in the same location. Did you check the created rebars? Is there any overlap? 

 

If there is nothing something like that. When you create 50m long girder, you can stop the code in the middle of the loop for a fair amount of time with this code

System.Threading.Thread.Sleep(sleep time (milisecond))

 

If none of them is helpful, you should post some of your code to check the problem. 

 

Hope this helps,

Recep.

0 Likes
Message 3 of 3

Anonymous
Not applicable

 

Thanks for your suggestions. I tried Thread.Sleep, but it could not lower the memory usage or improve the performance. I may have to rearrange my model to make the rebar host element as ‘light’ as possible. I can not understand why the rebar creation performance is affected by the host element so much.

 

0 Likes