Hi,
i am still wondering to find nothing about this topic by searching with google several hours.
To get my ideas across to you i modified the tictoc-example code a bit (see attachment).
I inserted just methods to get some output while simulation is running. Even so i added a new message type 'OwnMessage' which is inherited from cMessage. In OwnMessage i just implemented a constructor, the copy constructor and the destructor. In these Methods do nothing but output.
If you run the example-simulation with the gui either "step-by-step" (execute-on-event, F4) , "normal" (run with full animation, F5) or "fast" (run faster: no animation and rare inspector updates, F6) you will see that every time the send method is called a new message (with new id) is created inside the send method. While the message id for the message which is delivered to the next module is always 0, the message id for the copy of that message is always a new one, higher than that before.
This is the correct behavior because every massage, even a duplication of that message, must have its own message id.
But why is send making a copy of the message. And why will that message never been deleted? The output (and even the gui) shows that they are never deleted.
If you run the simulation in "express" (run at full speed: no output, animation or inspector updates, F7) there is just one copy of the message made at the start of the simulation. After that the counter will always show 2 created messages.
Am i on the wrong track with my idea that this could be a memory leak?
Another problem i detected is that if you run the simulation "fast" and the count of message reaches 100000 the simulation tries to delete the original message which leads to a problem because this message is still being sent and received by the tictoc modules. If you run the simulation in express there is no such problem even if your simulation reaches message counts higher than 100000.
Because i did not find anything about that behavior in the manual or the documentation i hope that some of you know some answers that can help me to understand the problems.
Kind regards
Korbinian