omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. nerdtronn
    3. Best

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 2
    • Topics 5
    • Posts 12
    • Best 3
    • Controversial 0
    • Groups 0

    Best posts made by nerdtronn

    • RE: debugging possible memory leak

      Thanks for the replies and suggestions!

      I tried using the approach of creating SpriteNode obs for each vertical slice in the graph and setting their texture to None along with the color as desired. Then, in the update, I just loop through them and set their size to (1, desired_height) and position to the proper place.

      On initial testing I noticed artifacts, gaps occasionally between the obs on screen. I bumped the size up to (1.1, desired_height) and that fixed it. Probably rounding errors, etc. causing some gaps. With this in place, it seems to be working and pythonista doesn't crash after awhile since I'm not continually creating new path obs with every update.

      The shader approach sounds interesting, seeing that now, but haven't tried it. Will keep that in mind for the future though, maybe worth experimenting with.

      posted in Pythonista
      nerdtronn
      nerdtronn
    • debugging possible memory leak

      I have a scene based script in pythonista which displays a filled graph of values over time.

      I implemented this by creating a list of ShapeNode objects. The number of these corresponds to the width of the display area. Each one is setup with ui.Path.rect(0,0,1,height). So each one is 1 pixel wide and the height corresponds to the value being graphed for that point in time. I create the set of ShapeNode objects only once.

      Once created, on each scene update, I set the heights of all the ShapeNode objects by assigning a new ui.Path. I did this as I didn't see a way to change the height of an existing ui.Path.

      The script seems to work well. But after it runs for a bit (still trying to get more precise timing on that), pythonista exits. My thought is that reassigning a couple hundred ui.Path's on each update may be leaking something.

      My understanding is that python should gc these. Is that correct?

      1. Is there a better way to adjust the height of the shapenode after it's created?

      2. Is there some explicit call I need to release these if re-creating them each time?

      3. Any idea on how to show current memory usage for my script so I could turn this functionality on off and see if I am getting continual growth in memory?

      posted in Pythonista
      nerdtronn
      nerdtronn
    • RE: async web request from a Scene script

      Thanks for the replies! Will dig into these and see what I can get working.

      posted in Pythonista
      nerdtronn
      nerdtronn