Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. ioBroker Allgemein
    4. [gelöst] FATAL ERROR: JavaScript heap out of memory

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] FATAL ERROR: JavaScript heap out of memory

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mwolle last edited by mwolle

      Moin zusammen,
      nach einem Update meine Raspi 4 mit 4GB Hauptspeicher erhalte ich bei einem iob update folgende Fehlermeldung:

      <--- Last few GCs --->
      
      [3403:0x5066e58]    79449 ms: Scavenge 954.6 (965.8) -> 954.4 (970.6) MB, 4.2 / 0.0 ms  (average mu = 0.579, current mu = 0.534) allocation failure 
      [3403:0x5066e58]    79599 ms: Mark-sweep (reduce) 961.1 (975.9) -> 960.8 (970.9) MB, 75.7 / 0.0 ms  (+ 38.6 ms in 27 steps since start of marking, biggest step 10.1 ms, walltime since start of marking 150 ms) (average mu = 0.471, current mu = 0.391) final
      
      <--- JS stacktrace --->
      
      FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
      /usr/bin/iob: Zeile 10:  3402 Abgebrochen             sudo -H -u iobroker node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js "$@"
      
      

      zur Zeit geht nun nichts mehr, iobroker fix gibt auch folgende Meldung:

      hecking for uncompressed JSONL databases... This might take a while!
      
      Compressing /opt/iobroker/iobroker-data/states.jsonl
      Compressing /opt/iobroker/iobroker-data/objects.jsonl
      
      <--- Last few GCs --->
      
      [2357:0x4a31f28]    23546 ms: Scavenge 956.1 (966.0) -> 955.9 (969.0) MB, 3.4 / 0.0 ms  (average mu = 0.472, current mu = 0.392) allocation failure 
      [2357:0x4a31f28]    23612 ms: Mark-sweep (reduce) 961.4 (974.4) -> 961.4 (971.1) MB, 33.0 / 0.0 ms  (+ 5.7 ms in 3 steps since start of marking, biggest step 4.1 ms, walltime since start of marking 65 ms) (average mu = 0.503, current mu = 0.534) finalize 
      
      <--- JS stacktrace --->
      
      FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
      Aborted
      
      

      ein

      free -h
                    gesamt       benutzt     frei      gemns.  Puffer/Cache verfügbar
      Speicher:      3,7Gi       394Mi       1,6Gi       142Mi       1,7Gi       3,1Gi
      Swap:           99Mi          0B        99Mi
      
      

      Bekomme ich das noch irgendwie repariert?

      Thomas Braun 1 Reply Last reply Reply Quote 0
      • Thomas Braun
        Thomas Braun Most Active @mwolle last edited by

        @mwolle

        iob diag
        

        spuckt was genau aus?

        M 1 Reply Last reply Reply Quote 0
        • M
          mwolle @Thomas Braun last edited by

          @thomas-braun

          ======================= SUMMARY =======================
          		     v.2022-12-31
          
          
          Operatingsystem: 	Raspbian GNU/Linux 11 (bullseye)
          Installation: 		Native
          Timezone: 		Europe/Berlin
          User-ID: 		1000
          X-Server: 		true
          Boot Target: 		graphical.target
          
          Pending OS-Updates: 	0
          
          Nodejs-Installation: 	/usr/bin/nodejs 	v16.19.0
          			/usr/bin/node 		v16.19.0
          			/usr/bin/npm 		8.19.3
          
          ioBroker Core: 		js-controller 		4.0.21
          			admin 			6.2.23
          
          
          <--- Last few GCs --->
          
          [5069:0x3fb7e58]    79610 ms: Mark-sweep 957.3 (968.9) -> 957.0 (974.7) MB, 119.3 / 0.0 ms  (average mu = 0.259, current mu = 0.131) allocation failure scavenge might not succeed
          
          
          <--- JS stacktrace --->
          
          FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
          /usr/bin/iobroker: line 10:  5068 Aborted                 sudo -H -u iobroker node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js "$@"
          ioBroker Status: 	
          
          Status admin:
          
          <--- Last few GCs --->
          
          [5087:0x55d0e88]    79700 ms: Mark-sweep 957.4 (969.2) -> 957.1 (974.7) MB, 130.7 / 0.0 ms  (average mu = 0.245, current mu = 0.137) allocation failure scavenge might not succeed
          
          
          <--- JS stacktrace --->
          
          FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
          /usr/bin/iobroker: line 10:  5086 Aborted                 sudo -H -u iobroker node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js "$@"
          
          
          <--- Last few GCs --->
          
          [5103:0x5630ef0]    79383 ms: Scavenge 955.0 (967.1) -> 955.0 (968.1) MB, 3.7 / 0.0 ms  (average mu = 0.509, current mu = 0.445) allocation failure 
          [5103:0x5630ef0]    79516 ms: Mark-sweep (reduce) 960.9 (973.4) -> 960.6 (971.7) MB, 77.3 / 0.0 ms  (+ 25.2 ms in 11 steps since start of marking, biggest step 18.0 ms, walltime since start of marking 133 ms) (average mu = 0.426, current mu = 0.351) final
          
          <--- JS stacktrace --->
          
          FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
          /usr/bin/iob: line 10:  5102 Aborted                 sudo -H -u iobroker node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js "$@"
          Pending iob updates: 	0
          
          
          <--- Last few GCs --->
          
          [5118:0x4f3fef0]    79633 ms: Mark-sweep (reduce) 957.4 (969.9) -> 957.3 (968.2) MB, 32.2 / 0.0 ms  (+ 37.2 ms in 22 steps since start of marking, biggest step 27.4 ms, walltime since start of marking 85 ms) (average mu = 0.411, current mu = 0.292) finali
          
          <--- JS stacktrace --->
          
          FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
          /usr/bin/iob: line 10:  5117 Aborted                 sudo -H -u iobroker node /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js "$@"
          
          Objects: 		0
          States: 		0
          
          Size of iob-Database:
          
          659M	/opt/iobroker/iobroker-data/objects.jsonl
          8.8M	/opt/iobroker/iobroker-data/states.jsonl
          
          
          =================== END OF SUMMARY ====================
          
          
          Thomas Braun Glasfaser 2 Replies Last reply Reply Quote 0
          • Thomas Braun
            Thomas Braun Most Active @mwolle last edited by Thomas Braun

            @mwolle

            Desktop ausschalten.

            Das dürfte der Blockierer sein:

            659M	/opt/iobroker/iobroker-data/objects.jsonl
            
            M 1 Reply Last reply Reply Quote 0
            • M
              mwolle @Thomas Braun last edited by

              @thomas-braun kann ich die Objekte ohne Admin verkleinern noch? Bzw. bekomm eich es noch mal ohne Desktop zum Laufen? (Weil Speicher frei?)

              Thomas Braun 1 Reply Last reply Reply Quote 0
              • Thomas Braun
                Thomas Braun Most Active @mwolle last edited by

                @mwolle

                Ich glaube @apollon77 hatte mal irgendwann und irgendwo eine Anleitung dagelassen wie man das 'zu Fuß' machen kann.

                Und einen Desktop betreibt man grundsätzlich nicht auf einem Server. Vollkommen unabhängig vom java heap.

                Glasfaser 1 Reply Last reply Reply Quote 0
                • Glasfaser
                  Glasfaser @Thomas Braun last edited by

                  @thomas-braun

                  siehe hier :
                  https://forum.iobroker.net/topic/60172/test-iobroker-fixer-mit-jsonl-compression

                  Du hast auch gesehen , das er nicht auf den aktuelle stand ist ...

                  OLD ...

                  ioBroker Core: 		js-controller 		4.0.21
                  
                  			admin 			6.2.23
                  
                  Thomas Braun M 2 Replies Last reply Reply Quote 0
                  • Thomas Braun
                    Thomas Braun Most Active @Glasfaser last edited by Thomas Braun

                    @glasfaser sagte in FATAL ERROR: JavaScript heap out of memory nach node Update:

                    Du hast auch gesehen , das er nicht auf den aktuelle stand ist ...

                    Klar, mit neuem js-controller wäre das ja auch (sehr wahrscheinlich) nicht mehr passiert.

                    Deswegen halt die Gebetsmühle anleiern:

                    Haltet den Kram auf einem aktuellen Stand!

                    1 Reply Last reply Reply Quote 0
                    • M
                      mwolle @Glasfaser last edited by

                      @glasfaser ich wollte es gerade ja updaten...Compression geht leider auch nicht (mehr)

                          Database maintenance (3/4)
                      ==========================================================================
                      
                      Checking for uncompressed JSONL databases... This might take a while!
                      
                      Compressing /opt/iobroker/iobroker-data/states.jsonl
                      Compressing /opt/iobroker/iobroker-data/objects.jsonl
                      
                      <--- Last few GCs --->
                      
                      [6084:0x4474f28]    19212 ms: Scavenge 951.0 (962.6) -> 950.8 (968.4) MB, 6.0 / 0.0 ms  (average mu = 0.708, current mu = 0.713) allocation failure 
                      [6084:0x4474f28]    19278 ms: Mark-sweep (reduce) 956.3 (973.7) -> 956.2 (966.7) MB, 35.9 / 0.0 ms  (+ 2.7 ms in 5 steps since start of marking, biggest step 2.6 ms, walltime since start of marking 66 ms) (average mu = 0.672, current mu = 0.625) finalize 
                      
                      <--- JS stacktrace --->
                      
                      FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
                      Aborted
                      
                      
                      Thomas Braun 1 Reply Last reply Reply Quote 0
                      • Glasfaser
                        Glasfaser @mwolle last edited by

                        @mwolle sagte in FATAL ERROR: JavaScript heap out of memory nach node Update:

                        659M /opt/iobroker/iobroker-data/objects.jsonl

                        zeige mal :

                        du -sh  /opt/iobroker/iobroker-data/backup-objects/*objects*
                        
                        M 1 Reply Last reply Reply Quote 0
                        • M
                          mwolle @Glasfaser last edited by

                          @glasfaser

                          du -sh  /opt/iobroker/iobroker-data/backup-objects/*objects*
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_07-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_09-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_11-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_13-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_15-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_17-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_19-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_21-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-03_23-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_01-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_03-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_05-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_07-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_09-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_11-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_13-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_15-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_17-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_19-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_21-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-04_23-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-05_01-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-05_03-51_objects.jsonl.gz
                          1,6M	/opt/iobroker/iobroker-data/backup-objects/2023-01-05_05-51_objects.jsonl.gz
                          
                          Glasfaser 1 Reply Last reply Reply Quote 0
                          • Glasfaser
                            Glasfaser @mwolle last edited by Glasfaser

                            @mwolle

                            iobroker stop
                            
                            cd /opt/iobroker/iobroker-data/
                            
                            mv objects.jsonl objects.jsonl.old
                            
                            cd backup-objects/
                            gunzip -ck 2023-01-03_07-51_objects.jsonl.gz > /opt/iobroker/iobroker-data/objects.jsonl
                            
                            iobroker start
                            
                            M 1 Reply Last reply Reply Quote 1
                            • Thomas Braun
                              Thomas Braun Most Active @mwolle last edited by

                              @mwolle

                              Oder versucht mal (wenn npm>7 ist)

                              npm x --yes @iobroker/jsonltool@latest /opt/iobroker/iobroker-data
                              
                              M 1 Reply Last reply Reply Quote 1
                              • M
                                mwolle @Thomas Braun last edited by

                                @thomas-braun

                                npm -v
                                8.19.3
                                
                                
                                npm x --yes @iobroker/jsonltool@latest /opt/iobroker/iobroker-data
                                Compressing /opt/iobroker/iobroker-data/states.jsonl
                                Cannot compress states.jsonl: Error: Failed to lock DB file "/opt/iobroker/iobroker-data/states.jsonl"!
                                    at JsonlDB.open (/home/iobroker/.npm/_npx/36bee06d4228a674/node_modules/@alcalzone/jsonl-db/build/lib/db.js:185:19)
                                    at async compressDB (/home/iobroker/.npm/_npx/36bee06d4228a674/node_modules/@iobroker/jsonltool/index.js:37:9)
                                    at async main (/home/iobroker/.npm/_npx/36bee06d4228a674/node_modules/@iobroker/jsonltool/index.js:78:17)
                                Compressing /opt/iobroker/iobroker-data/objects.jsonl
                                Cannot compress objects.jsonl: Error: Failed to lock DB file "/opt/iobroker/iobroker-data/objects.jsonl"!
                                    at JsonlDB.open (/home/iobroker/.npm/_npx/36bee06d4228a674/node_modules/@alcalzone/jsonl-db/build/lib/db.js:185:19)
                                    at async compressDB (/home/iobroker/.npm/_npx/36bee06d4228a674/node_modules/@iobroker/jsonltool/index.js:37:9)
                                    at async main (/home/iobroker/.npm/_npx/36bee06d4228a674/node_modules/@iobroker/jsonltool/index.js:93:17)
                                No relevant JSONL files found to compress, skip
                                
                                Thomas Braun 1 Reply Last reply Reply Quote 0
                                • Thomas Braun
                                  Thomas Braun Most Active @mwolle last edited by

                                  @mwolle

                                  iob stoppen
                                  und schauen ob noch Prozesse herumgeistern.

                                  M 1 Reply Last reply Reply Quote 0
                                  • M
                                    mwolle @Glasfaser last edited by

                                    @glasfaser

                                    iobroker stop
                                     cd /opt/iobroker/iobroker-data/
                                    mv objects.jsonl objects.jsonl.old
                                    cd backup-objects/
                                    gunzip -ck 2023-01-03_07-51_objects.jsonl.gz > /opt/iobroker/iobroker-data/objects.jsonl
                                    iobroker start
                                    

                                    das scheint funktioniert zu haben, zumindest konnte ich jetzt Komprimieren und ein iob update klappte wieder

                                    1 Reply Last reply Reply Quote 1
                                    • M
                                      mwolle @Thomas Braun last edited by

                                      @thomas-braun ja das hat sich mit dem anderem Verfahren überschnitten. Komprimieren klappte nun

                                      1 Reply Last reply Reply Quote 0
                                      • apollon77
                                        apollon77 last edited by

                                        Also ich fasse zusammen: Eine <770MB objects.json konnte bei 1,6GB "free" speicher nicht komprimiert werden? und iobroker war zu dem zeitounkt auch gestoppt? Was bracuht dann 2GB RAM ? aber naja ok... ihr habt es hinbekommen ... für mich passt da was nicht zusammen

                                        Thomas Braun 1 Reply Last reply Reply Quote 0
                                        • Thomas Braun
                                          Thomas Braun Most Active @apollon77 last edited by

                                          @apollon77 sagte in [gelöst] FATAL ERROR: JavaScript heap out of memory:

                                          für mich passt da was nicht zusammen

                                          Stimmt, kam mir eigentlich auch seltsam vor.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post

                                          Support us

                                          ioBroker
                                          Community Adapters
                                          Donate
                                          FAQ Cloud / IOT
                                          HowTo: Node.js-Update
                                          HowTo: Backup/Restore
                                          Downloads
                                          BLOG

                                          966
                                          Online

                                          31.8k
                                          Users

                                          80.0k
                                          Topics

                                          1.3m
                                          Posts

                                          4
                                          19
                                          1213
                                          Loading More Posts
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          Community
                                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                          The ioBroker Community 2014-2023
                                          logo