Message Boards Message Boards

0
|
10681 Views
|
11 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Avoid error "Failed to allocate String character memory..."?

I'm using the Media library and am getting this error:

[ERROR]: Failed to allocate String character memory of size 3001 from heap of fixed size 20000000.

No other details that I can see. The model was running and I'm not sure what changed. This is on Wolfram SystemModeler v.12 running on macOS.

EDIT: I switched my Media from CH4 to Air and it worked. I tried other gasses in Media.IdealGases and they all gave the heap error. When I cut the size of my model in half it works fine (both uncoupled halves work).

Not sure there's enough information to do anything, but any help would be appreciated.

POSTED BY: Eric Smith
11 Replies

That's good to hear. Don't hesitate to tell us about your application in case you think that the kind of string processing you were doing could be of general interest – requests like that are important for setting the right priorities for future product development.

POSTED BY: Henrik Tidefelt

Yes, I removed all that and it is running nicely now.

POSTED BY: Claudio Argento

I see. System Modeler currently only has basic support for strings, and it sounds as if your approach might require a more complete solution for string handling. If this is the case, it is something we see very rarely – is there any chance that the "heavy" string processing could be lifted also out of your model?

POSTED BY: Henrik Tidefelt

The Dynamic assert strings setting was introduced to avoid a performance problem which is now handled using better code generation instead. However, the setting happened to also provide a workaround for hitting the string size constraints in the context of asserts, and for this there is currently no replacement for the setting.

Without knowing more about your particular model, it is not clear whether the problems are related to asserts, or what could be the source of the large strings. To better understand what workarounds one could try or how the product could be improved it would be interesting to know more about your model, such as the type of the added component.

POSTED BY: Henrik Tidefelt

Thank you for the reply. I don't think there is any calls to "assert" in the code. There are several calls to read/write input and output files. When I commented that out, it runs fine.

POSTED BY: Claudio Argento

I am still having this problem with my model. I add/remove one component in a large model and it triggers the error. I can't find the "Dynamic assert strings" setting in my WSM version (Windows, 12.3). Any suggestions would be appreciated.

POSTED BY: Claudio Argento

OK, it's good that you can confirm that this is the problem that the Dynamic assert strings setting was meant to address. Then, of course, it's too bad that it didn't solve your problems for the larger system. It is a known issue that the user can't change the size of the memory used to hold strings during expression evaluation, and I'm adding you as a reporter of this.

POSTED BY: Henrik Tidefelt

I just checked this in Windows (I had found discrepancies between the OS versions in the past). I am getting the same error. It happens with the ideal gas components, but not with Air. I'm going to tag @Ankit Naik and @Jan Brugard to see if they have any ideas

POSTED BY: Eric Smith

Did you try turning off Dynamic assert strings under Preferences -> General -> Translation?

POSTED BY: Henrik Tidefelt

While I didn't know what it meant, I saw the word "strings" and turned it off and still had the issue. So I did try that, but thanks for the suggestion.

POSTED BY: Eric Smith

I turned this off in Simulation Center but not in Model Center. I turned off "Dynamic assert strings" in both places and the error went away. Thank you!

Edit: Tried a larger system and the error came back

POSTED BY: Eric Smith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract