question

anon-user avatar image
0 Likes"
anon-user asked Phil BoBo commented

 Large memory consumption

This data was created by our business partners.

It is set to private for confidentiality by NDA.


Running this data on FlexSim 20.1.3 consumes more than 10GB of memory.

Please tell me the cause of such a large amount of memory consumption.



FlexSim 20.1.3
flexsim 20.1.3memory leakmemory
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi anonymous user, was my answer helpful? If so, please click the red "Accept" button at the bottom of my answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Ben Wilson avatar image
0 Likes"
Ben Wilson answered Phil BoBo commented

There is a very large number of flowitems produced. I used this script and ran it at time 200:

int total = 0;
for (int i=4; i<=content(model); i++) {
    treenode object = rank(model, i);
    int numSubNodes = content(object);
    print(getname(object), ": ", numSubNodes);
    total += numSubNodes;
}
print("TOTAL: ", total);

This prints to the Output Console each object at the model's main level, then its number of child objects (mostly these will be flow items).

At time 200 there are 1,556,647 flow items in the model. This is the cause of the massive memory utilization. Without taking into account any additional model overhead, if I just take the 11.5 GB RAM the model was using at that time and divide by the 1.56 million flow items, that comes to about 7.8 KB per flow item. This seems reasonable given the sizes of the standard flow items:

If this doesn't sound right, you should check your flow item production to make sure your rates are correct.

If it is correct, you should probably implement some techniques to minimize the number of items in the model at one time. This can be done using tables or bundles to track items that are currently in a buffer, making them "virtual" until they are needed again in the model, at which time they can be instantiated as new flow items. This takes more CPU time, but that is the RAM / CPU trade-off that you'll have with this model.

FlexSim's Storage System is made for this sort of high-volume scenario. Please find the heading called "Virtual Items":

For models with high quantities of flowitems in inventory (10,000+ items), memory use and draw speed can both become issues. In these situations, you can choose to virtualize items.

1619477747045.png (30.2 KiB)
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

To add to Ben's description:

One example of excess flowitems is in the object ソース4. It is a source that is producing 18 items every second on a repeating arrival schedule. When I ran the model for just a few moments, that source had produced and was holding 200,000+ flowitems.

0 Likes 0 ·
anon-user avatar image anon-user commented ·

Please tell me more.


Most items from the source are Blocked.

But does it consume memory even if it is Blocked?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ anon-user commented ·

Yes, it is creating the flowitems and storing them in the Source, waiting for it to be unblocked to send them. You can see in the tree that there are millions of flowitems in the Source objects.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.