MEMORY related problems

Issue #77 resolved
Turgut Guneysu created an issue

Hello John,

I started experiencing immediate and recurring memory related problems with the attached program. I do not want to classify it as a bug, but it is happening every single time I try to edit the code.

Here is the sequence of edits (I don’t think the sequence matters , though) I am trying to implement on the first visible Custom Block “UART-TX-set” and corresponding command status:

Edit Action Command.com display
Load Program
Delete parameter “parity” Click back triangle to delete label Parity no change
Rename label @pin to @TXpin no change
Rename corresponding parameter “pin” to “txPin” Long wait, followed by Debugger display: And command window showing:
Clicking on Debugger top Right “X” to close window No change
Clicking on “set UARTpinTX to <pin>” to change the pin parameter to the new txPin Steady on-going display of : followed by termination of command window and the microBlocks editor.

I am hoping you will shed some light on what is going wrong with this.

In my view the program is not even that big ! FREE MEMORY block show 625.

I have not even executed the program - just trying to EDIT it.

Here 's a task manager snapshot of the problem instance:

NOTE: I have noticed that the microBlocks editor is a 32-bit program. Any reason why there is not a 64bit version. Could the memory issue have anything to do with this?

I am running on a laptop with 16GB or memory, WIN10 Home Ed 64bit, 1TB SSD.

TG

Comments (10)

  1. John Maloney repo owner

    Reproduced. Deleting the optional parameter “parity” puts the block definition into a bad state, after which various other operations (including attempting to save the project) fail. But, optional parameters are not officially supported so it may be a while before this one gets fixed. I suggest you work around by saving the project, removing the parameter with a text editor, then reloading.

  2. Turgut Guneysu reporter

    Hi John,

    Thanks for this. However, I do not understand what you mean by “optional parameter”?

    All of the parameters are needed for the program, none optional.

    Is there something I typed in the label or parameter that makes it “optional” from your perspective?

    If so I did not intend it to be that way. Please explain what makes it optional, so I can avoid it.

    Thx.

  3. John Maloney repo owner

    Ahh! Optional parameters are ones that you can hide and show using the left-right arrows. You can create them accidentally them by including a colon in the label. Could that be what you did?

    It’s a definitely a bug that this is possible; you should be able to type whatever you like in the label parts of a block definition.

  4. Turgut Guneysu reporter

    Hı John

    Please don't think that I am counter arguing, just trying to understand:

    I did not use any : when creating the arguments and they are all needed and NOT optional.

    Questions:

    1. Does using a label make the argument optional? As opposed to listing them without labels (just values)? Other than using the :
    2. If any left/right arrow created parameter is an optional one, how can a function have more than one parameter that is not optional?

    Regardless of the questions above, I anticipate that arguments and their labels in custom blocks can be created, as many as needed , as long as one DOES NOT USE a : in the labels of the arguments. Just having more than one label / argument pair does not make them optional.

    Thanks for your patience.

  5. John Maloney repo owner

    The colon is used in the internal representation to make an argument (and its label, if any) optional. However, since the label strings get inserted directly into that internal representation, a colon in a label string can result in the things following it being considered optional even if that wasn’t what was intended. It’s a bug that this is even possible, and I’ll fix that in the next release.

    Labels do not make arguments optional and you can have many parameters and labels as you want.

    1. If any left/right arrow created parameter is an optional one, how can a function have more than one parameter that is not optional?

    Using the right arrow in the procedure definition block adds a normal lable or parameter, not an optional one (unless, as mentioned, the label contains a colon, but that’s a bug).

    I hope that helps, and sorry you ran into this confusing bug.

  6. Log in to comment