Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Memory allocation Issue in Raspberry pi 4b 8GB Ram
Qt 6.11 is out! See what's new in the release blog

Memory allocation Issue in Raspberry pi 4b 8GB Ram

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 399 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Gautham0517
    wrote on last edited by
    #1

    Hi I am bulding a Dashboard appliacion where i want to integrate the maps Using the General magic plugin. When i am running the applicaiton on my Desktop its running perfectly but when i try to run the same in my Raspberry Pi its showing the following memory allocation issue both my Desktop and Raspberr Pi has 8gb of ram.

    QT version : 5.15.2
    Raspberry PI OS : Raspberrypi os
    Raspberry Pi SD Card : 64gb
    Desktop OS : Ubuntu OS

    My Code :
    import QtQuick 2.15
    import QtQuick.Controls 2.5
    import QtQuick.Layouts 1.3
    import Style 1.0
    import GeneralMagic 2.0
    import "../Component"

    EaglePage {
    id:root
    width: 510 // Adjusted width
    height: 220 // Adjusted height
    property var updater: ServicesManager.contentUpdater(ContentItem.Type.RoadMap)
    Component.onCompleted: {
    //! [Set token safely]
    ServicesManager.settings.token = __my_secret_token;
    //! [Set token safely]
    ServicesManager.settings.allowInternetConnection = true; // enable connection to online services

        updater.autoApplyWhenReady = true;
        updater.update();
    }
    //! [RoutingNavigation plumbing]
    
    //! [RoutingNavigation routing]
    RoutingService {
        id: routingService
        type: Route.Type.Fastest
        transportMode: Route.TransportMode.Car
    
        waypoints: LandmarkList {
            Landmark {
                name: "start"
                coordinates: Coordinates {
                    latitude: 48.849289
                    longitude: 2.346027
                }
            }
            Landmark {
                name: "stop"
                coordinates: Coordinates {
                    latitude: 48.874630
                    longitude: 2.331512
                }
            }
        }
        onFinished: {
            mapView.routeCollection.set(routeList);
            mapView.centerOnRouteList(routeList);
        }
    }
    //! [RoutingNavigation routing]
    
    //! [RoutingNavigation navigation]
    function distance(meters)
    {
        return meters >= 1000 ? (meters / 1000.).toFixed(3) + " Km" :  meters.toFixed(0) + " m";
    }
    
    NavigationService {
        id: navigation
        route: mapView.routeCollection.mainRoute
        simulation: true // change it to false (default) to perform real turn by turn navigation
        onActiveChanged: {
            if (active) {
                mapView.startFollowingPosition();
                mapView.routeCollection.clear(true /*keepMainRoute*/);
            }
        }
    
        onCurrentInstructionChanged: {
            // WORKS ONLY with Qt 5.15.x or Qt 6.x
            const nextspeedlimit = currentInstruction.nextSpeedLimitVariation();
            console.log(nextspeedlimit.distance, nextspeedlimit.speed,
                        nextspeedlimit.coordinates.latitude, nextspeedlimit.coordinates.longitude);
        }
    
        onWaypointReached: console.log("WaypointReached :" + waypoint.name);
        onDestinationReached: mapView.routeCollection.clear();
        onNavigationError: {
            console.log("NavigationError :" + error);
            mapView.routeCollection.clear();
        }
        onNavigationRouteUpdated: {
            console.log("RouteUpdated :" + route.summary);
            mapView.routeCollection.add(route, true);
            mapView.routeCollection.clear(true);
        }
    }
    //! [RoutingNavigation navigation]
    
    //! [RoutingNavigation mapView]
    MapView {
        id: mapView
        anchors.fill: parent
        viewAngle: 25
        cursorVisibility: false
    
        onRouteSelected: {
            routeCollection.mainRoute = route;
            centerOnRoute(route);
            console.log("Route selected, centering:" + route.summary);
        }
    //! [RoutingNavigation mapView]
    
        Rectangle {
            color: Qt.rgba(1, 1, 1, 0.75)
            visible: navigation.active
            anchors.top: parent.top
            anchors.left: parent.left
            anchors.right: parent.right
            height: 64
            RowLayout {
                anchors.fill: parent
                anchors.margins: 10
                DynamicIconView {
                    Layout.fillHeight: true
                    Layout.maximumWidth: height
                    width: height
                    arrowInner: "darkblue"
                    arrowOuter: "gold"
                    slotInner: "grey"
                    slotOuter: arrowOuter
    
                    iconSource: navigation.currentInstruction.nextTurnDynamicIcon
                }
                Label {
                    Layout.fillWidth: true
                    font.pixelSize: 16
    
                    text: navigation.currentInstruction.nextStreetName + " (" + distance(navigation.currentInstruction.distanceToNextTurn) + ")";
                }
                DynamicIconView {
                    Layout.fillHeight: true
                    Layout.maximumWidth: height
                    width: height
                    arrowInner: "darkgrey"
                    arrowOuter: "black"
                    slotInner: "grey"
                    slotOuter: "darkgreen"
    
                    iconSource: navigation.currentInstruction.nextNextTurnDynamicIcon
                }
                Label {
                    font.pixelSize: 14
                    text: distance(navigation.currentInstruction.distanceToNextNextTurn)
                }
            }
        }
    
        RowLayout {
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            //! [RoutingNavigation compute routing]
            Button {
                text: "Compute route(s)"
                enabled: ServicesManager.settings.connected && !navigation.active
                onClicked: routingService.update()
            }
            //! [RoutingNavigation compute routing]
            Item {
                Layout.fillWidth: true
            }
            Button {
                enabled: mapView.routeCollection.mainRoute.valid
                text: navigation.active ? "Stop simulation" : "Start simulation"
                onClicked: navigation.active = !navigation.active
            }
        }
    //! [RoutingNavigation mapView end]
    }
    

    }

    ERROR:
    02:24:07: Starting /usr/local/qt5.15/examples/GeneralMagic/RoutingNavigation/EagleTheme on Raspi4...
    QML debugging is enabled. Only use this in a safe environment.
    GEM:

    ##############################################################################
    ################## Magic Lane log ####################
    ################## Date 2024-05-01 02:24:08.590 UTC+05:30 ####################
    ################## Version 07.01.23.41.0A7CA7F4 ####################
    ##############################################################################

    GEM: I/E May 01 02:24:08.595 <SDK>gemImpl::SDK::Produce Device=Unknown, OS=GNU/Linux:Unknown, timer=0x1DB4F4C, appVariant=4294967295 ( client=4095, product=255, hosting=15, flavor=255 ), phoneDataPath=:/GENERAL_MAGIC_DATA, mmcDataPath=/home/hut/.cache/Amrita/Eagle Theme/GeneralMagic, savePolicy=1, lang=, ttsLang= logger=0x1DB4F48, platform support=qt [ SDKImpl.cpp:980 ]
    GEM: I/E May 01 02:24:08.603 <SDK><std::function<void> UI language: eng-USA-Latn-0 [ SDKImpl.cpp:1180 ]
    GEM: I/E May 01 02:24:08.603 <SDK><std::function<void> TTS language: eng-USA-Latn-0 [ SDKImpl.cpp:1181 ]
    GEM: I/E May 01 02:24:08.603 <SDK><std::function<void> STT language: eng-USA-Latn-0 [ SDKImpl.cpp:1182 ]
    GEM: I/E May 01 02:24:08.603 <SDK>COnlineDataStorage::Init Use external: 1, allow switch: 1 [ OnlineDataStorage.cpp:80 ]
    GEM: I/E May 01 02:24:08.603 <SDK>COnlineDataStorage::Init Init online storage: select path /home/hut/.cache/Amrita/Eagle Theme/GeneralMagic/Data/Temporary/Tiles/, free space 48620.09 MB [ OnlineDataStorage.cpp:163 ]
    GEM: I/E May 01 02:24:08.668 <DBReader>DBReader::TTilesDiskCache::Init Online map cache memory size: 1295620 [ OffboardCaches.cpp:201 ]
    GEM: I/E May 01 02:24:08.669 <DBReader>DBReader::CDBStorage_Client::ResizeFileCaches Main cache size: 402.36 KB, Aux cache size: 88.53 KB [ StorageClient.cpp:152 ]
    GEM: I/E May 01 02:24:08.669 <SDK>CWorldMapDB::InitMap World map loaded : :/GENERAL_MAGIC_DATA/Data/Res/WM_7_271.map [ WorldMapDB.cpp:1016 ]
    GEM: F/E May 01 02:24:08.671 <Platform>gp::MemMgr::AllocFail Out of memory allocating -997845960 bytes [ MemMgrP.cpp:1344 ]
    GEM: E/E May 01 02:24:08.671 <RUNTIME ASSERTION>gp::MemMgr::AllocFail false ( /home/balazs/Work/ORLANDO_UI_SPLIT/Src/Platform/Src/Alloc/MemMgrP.cpp:1345 ) [ SystemP.cpp:952 ]
    GEM: E/E May 01 02:24:08.685 <Platform>gp::Platform::DumpPlatformContext DUMP platform context [ PlatformP.cpp:1145 ]
    GEM: E/E May 01 02:24:08.685 <Platform>gp::Platform::DumpPlatformContext SDK create thread last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1151 ]
    GEM: E/E May 01 02:24:08.685 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xdf7fe3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
    GEM: E/E May 01 02:24:08.685 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xdffff3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
    GEM: E/E May 01 02:24:08.685 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xe09ff3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
    GEM: E/E May 01 02:24:08.686 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xe13ad3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
    GEM: E/E May 01 02:24:08.686 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xe1bae3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
    02:24:08: /usr/local/qt5.15/examples/GeneralMagic/RoutingNavigation/EagleTheme on Raspi4 exited with code 255

    Note: I know that still i did not provided the api key.

    thank you in Advance......

    Axel SpoerlA 1 Reply Last reply
    0
    • G Gautham0517

      Hi I am bulding a Dashboard appliacion where i want to integrate the maps Using the General magic plugin. When i am running the applicaiton on my Desktop its running perfectly but when i try to run the same in my Raspberry Pi its showing the following memory allocation issue both my Desktop and Raspberr Pi has 8gb of ram.

      QT version : 5.15.2
      Raspberry PI OS : Raspberrypi os
      Raspberry Pi SD Card : 64gb
      Desktop OS : Ubuntu OS

      My Code :
      import QtQuick 2.15
      import QtQuick.Controls 2.5
      import QtQuick.Layouts 1.3
      import Style 1.0
      import GeneralMagic 2.0
      import "../Component"

      EaglePage {
      id:root
      width: 510 // Adjusted width
      height: 220 // Adjusted height
      property var updater: ServicesManager.contentUpdater(ContentItem.Type.RoadMap)
      Component.onCompleted: {
      //! [Set token safely]
      ServicesManager.settings.token = __my_secret_token;
      //! [Set token safely]
      ServicesManager.settings.allowInternetConnection = true; // enable connection to online services

          updater.autoApplyWhenReady = true;
          updater.update();
      }
      //! [RoutingNavigation plumbing]
      
      //! [RoutingNavigation routing]
      RoutingService {
          id: routingService
          type: Route.Type.Fastest
          transportMode: Route.TransportMode.Car
      
          waypoints: LandmarkList {
              Landmark {
                  name: "start"
                  coordinates: Coordinates {
                      latitude: 48.849289
                      longitude: 2.346027
                  }
              }
              Landmark {
                  name: "stop"
                  coordinates: Coordinates {
                      latitude: 48.874630
                      longitude: 2.331512
                  }
              }
          }
          onFinished: {
              mapView.routeCollection.set(routeList);
              mapView.centerOnRouteList(routeList);
          }
      }
      //! [RoutingNavigation routing]
      
      //! [RoutingNavigation navigation]
      function distance(meters)
      {
          return meters >= 1000 ? (meters / 1000.).toFixed(3) + " Km" :  meters.toFixed(0) + " m";
      }
      
      NavigationService {
          id: navigation
          route: mapView.routeCollection.mainRoute
          simulation: true // change it to false (default) to perform real turn by turn navigation
          onActiveChanged: {
              if (active) {
                  mapView.startFollowingPosition();
                  mapView.routeCollection.clear(true /*keepMainRoute*/);
              }
          }
      
          onCurrentInstructionChanged: {
              // WORKS ONLY with Qt 5.15.x or Qt 6.x
              const nextspeedlimit = currentInstruction.nextSpeedLimitVariation();
              console.log(nextspeedlimit.distance, nextspeedlimit.speed,
                          nextspeedlimit.coordinates.latitude, nextspeedlimit.coordinates.longitude);
          }
      
          onWaypointReached: console.log("WaypointReached :" + waypoint.name);
          onDestinationReached: mapView.routeCollection.clear();
          onNavigationError: {
              console.log("NavigationError :" + error);
              mapView.routeCollection.clear();
          }
          onNavigationRouteUpdated: {
              console.log("RouteUpdated :" + route.summary);
              mapView.routeCollection.add(route, true);
              mapView.routeCollection.clear(true);
          }
      }
      //! [RoutingNavigation navigation]
      
      //! [RoutingNavigation mapView]
      MapView {
          id: mapView
          anchors.fill: parent
          viewAngle: 25
          cursorVisibility: false
      
          onRouteSelected: {
              routeCollection.mainRoute = route;
              centerOnRoute(route);
              console.log("Route selected, centering:" + route.summary);
          }
      //! [RoutingNavigation mapView]
      
          Rectangle {
              color: Qt.rgba(1, 1, 1, 0.75)
              visible: navigation.active
              anchors.top: parent.top
              anchors.left: parent.left
              anchors.right: parent.right
              height: 64
              RowLayout {
                  anchors.fill: parent
                  anchors.margins: 10
                  DynamicIconView {
                      Layout.fillHeight: true
                      Layout.maximumWidth: height
                      width: height
                      arrowInner: "darkblue"
                      arrowOuter: "gold"
                      slotInner: "grey"
                      slotOuter: arrowOuter
      
                      iconSource: navigation.currentInstruction.nextTurnDynamicIcon
                  }
                  Label {
                      Layout.fillWidth: true
                      font.pixelSize: 16
      
                      text: navigation.currentInstruction.nextStreetName + " (" + distance(navigation.currentInstruction.distanceToNextTurn) + ")";
                  }
                  DynamicIconView {
                      Layout.fillHeight: true
                      Layout.maximumWidth: height
                      width: height
                      arrowInner: "darkgrey"
                      arrowOuter: "black"
                      slotInner: "grey"
                      slotOuter: "darkgreen"
      
                      iconSource: navigation.currentInstruction.nextNextTurnDynamicIcon
                  }
                  Label {
                      font.pixelSize: 14
                      text: distance(navigation.currentInstruction.distanceToNextNextTurn)
                  }
              }
          }
      
          RowLayout {
              anchors.left: parent.left
              anchors.right: parent.right
              anchors.bottom: parent.bottom
              //! [RoutingNavigation compute routing]
              Button {
                  text: "Compute route(s)"
                  enabled: ServicesManager.settings.connected && !navigation.active
                  onClicked: routingService.update()
              }
              //! [RoutingNavigation compute routing]
              Item {
                  Layout.fillWidth: true
              }
              Button {
                  enabled: mapView.routeCollection.mainRoute.valid
                  text: navigation.active ? "Stop simulation" : "Start simulation"
                  onClicked: navigation.active = !navigation.active
              }
          }
      //! [RoutingNavigation mapView end]
      }
      

      }

      ERROR:
      02:24:07: Starting /usr/local/qt5.15/examples/GeneralMagic/RoutingNavigation/EagleTheme on Raspi4...
      QML debugging is enabled. Only use this in a safe environment.
      GEM:

      ##############################################################################
      ################## Magic Lane log ####################
      ################## Date 2024-05-01 02:24:08.590 UTC+05:30 ####################
      ################## Version 07.01.23.41.0A7CA7F4 ####################
      ##############################################################################

      GEM: I/E May 01 02:24:08.595 <SDK>gemImpl::SDK::Produce Device=Unknown, OS=GNU/Linux:Unknown, timer=0x1DB4F4C, appVariant=4294967295 ( client=4095, product=255, hosting=15, flavor=255 ), phoneDataPath=:/GENERAL_MAGIC_DATA, mmcDataPath=/home/hut/.cache/Amrita/Eagle Theme/GeneralMagic, savePolicy=1, lang=, ttsLang= logger=0x1DB4F48, platform support=qt [ SDKImpl.cpp:980 ]
      GEM: I/E May 01 02:24:08.603 <SDK><std::function<void> UI language: eng-USA-Latn-0 [ SDKImpl.cpp:1180 ]
      GEM: I/E May 01 02:24:08.603 <SDK><std::function<void> TTS language: eng-USA-Latn-0 [ SDKImpl.cpp:1181 ]
      GEM: I/E May 01 02:24:08.603 <SDK><std::function<void> STT language: eng-USA-Latn-0 [ SDKImpl.cpp:1182 ]
      GEM: I/E May 01 02:24:08.603 <SDK>COnlineDataStorage::Init Use external: 1, allow switch: 1 [ OnlineDataStorage.cpp:80 ]
      GEM: I/E May 01 02:24:08.603 <SDK>COnlineDataStorage::Init Init online storage: select path /home/hut/.cache/Amrita/Eagle Theme/GeneralMagic/Data/Temporary/Tiles/, free space 48620.09 MB [ OnlineDataStorage.cpp:163 ]
      GEM: I/E May 01 02:24:08.668 <DBReader>DBReader::TTilesDiskCache::Init Online map cache memory size: 1295620 [ OffboardCaches.cpp:201 ]
      GEM: I/E May 01 02:24:08.669 <DBReader>DBReader::CDBStorage_Client::ResizeFileCaches Main cache size: 402.36 KB, Aux cache size: 88.53 KB [ StorageClient.cpp:152 ]
      GEM: I/E May 01 02:24:08.669 <SDK>CWorldMapDB::InitMap World map loaded : :/GENERAL_MAGIC_DATA/Data/Res/WM_7_271.map [ WorldMapDB.cpp:1016 ]
      GEM: F/E May 01 02:24:08.671 <Platform>gp::MemMgr::AllocFail Out of memory allocating -997845960 bytes [ MemMgrP.cpp:1344 ]
      GEM: E/E May 01 02:24:08.671 <RUNTIME ASSERTION>gp::MemMgr::AllocFail false ( /home/balazs/Work/ORLANDO_UI_SPLIT/Src/Platform/Src/Alloc/MemMgrP.cpp:1345 ) [ SystemP.cpp:952 ]
      GEM: E/E May 01 02:24:08.685 <Platform>gp::Platform::DumpPlatformContext DUMP platform context [ PlatformP.cpp:1145 ]
      GEM: E/E May 01 02:24:08.685 <Platform>gp::Platform::DumpPlatformContext SDK create thread last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1151 ]
      GEM: E/E May 01 02:24:08.685 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xdf7fe3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
      GEM: E/E May 01 02:24:08.685 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xdffff3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
      GEM: E/E May 01 02:24:08.685 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xe09ff3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
      GEM: E/E May 01 02:24:08.686 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xe13ad3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
      GEM: E/E May 01 02:24:08.686 <Platform><gp::Platform::DumpPlatformContext()::<lambda> Thread 0xe1bae3c0 last error: No error : sys err (0), details () ( :0 ) [ PlatformP.cpp:1159 ]
      02:24:08: /usr/local/qt5.15/examples/GeneralMagic/RoutingNavigation/EagleTheme on Raspi4 exited with code 255

      Note: I know that still i did not provided the api key.

      thank you in Advance......

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @Gautham0517 said in Memory allocation Issue in Raspberry pi 4b 8GB Ram:

      GEM: F/E May 01 02:24:08.671 <Platform>gp::MemMgr::AllocFail Out of memory allocating

      The Raspberry is out of memory, I'd say.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved