Announcement

Collapse
No announcement yet.

Reducing the size of RAM data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reducing the size of RAM data

    Hello, I am working on a project that exceeded the maximal RAM size of 14kB and most of the RAM memory seems to be consumed by Img_elements. I'd like to know what exactly fits into this category. For example if I have a user button with multiple pictures (up, up pressed, down,...) and I remove some the total memory consumed doesn't seem to go down, yet if I remove the picture altogether the size goes down. If I were to know what sort of information exactly is stored in Img_elements I would have an easier time reducing the size of my code, by focusing on specific parts of it that are large.

    A follow up question, I don't suppose there is a way to list the total memory requirement size of the elements say per one form? Something along the lines of FORM0 ----- 120kB, FORM1 ----- 5kB, that would also be amazing.

  • #2
    Hello,

    Welcome to the forum!

    For example if I have a user button with multiple pictures (up, up pressed, down,...) and I remove some the total memory consumed doesn't seem to go down, yet if I remove the picture altogether the size goes down.
    When you add a "Userbutton" and upload it on the display - its' address and other properties will be stored in the FLASH memory,
    while all the graphics/images contained in that widget will be the supporting graphics (.DAT, .CGI - generated by the Workshop4)
    files needed on your project. If you chose your program destination to 'Run from RAM', the program residing in the FLASH memory will be copied on RAM, and execute the program there.

    For a detailed explanation about this topic, you may refer to this application note
    AN-00202 ViSi-Geni Program Destination: https://4dsystems.com.au/blog/4d-an-00202/

    A follow up question, I don't suppose there is a way to list the total memory requirement size of the elements say per one form? Something along the lines of FORM0 ----- 120kB, FORM1 ----- 5kB,
    AFAIK, there is not however, you can print the available memory using the mem_Heap(); command - which is the total memory available on your program.

    Best Regards,
    Kevin

    Comment


    • dadamkovic
      dadamkovic commented
      Editing a comment
      Thanks for the quick response, I figured it out and managed to fit my program into the display. The problem for me was that I did not realize just how much memory individual lines of text consume if you don't merge them together. I easily got rid of about 2-3kB of RAM memory data just by fitting most of the text in my forms into a single field.

    • John Kevin
      John Kevin commented
      Editing a comment
      Hi,

      Thank you for getting back to us. I am glad that you manage to utilize the RAM for your application.

      Best Regards,
      Kevin
Working...
X