MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    如何以较低的内存占用运行mirai

    使用交流
    3
    5
    126
    Loading More Posts
    • 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.
    • I-love-study
      I-love-study last edited by

      在使用 hotspot 作为 jvm 的 java 的时候,即使在刚开始运行的时候,也会占用约240Mb的内存。将其换成 openj9,虽然说降低了 30% 的内存,但也还是占用了差不多 168Mb 的内存
      所以想在这里跟大家询问一下,有什么办法能够以较低的内存占用运行mirai

      1 Reply Last reply Reply Quote 0
      • RainChan
        RainChan 大嗨客 last edited by

        使用32位jre

        I-love-study 1 Reply Last reply Reply Quote 0
        • I-love-study
          I-love-study @RainChan last edited by

          @RainChan
          试了一下,发现32位的hotspot内存占用甚至比64位的openj9还要高
          (32位hotspot: 177Mb, 64位openj9: 163Mb)
          (因为32位openj9不知道哪里找所以没测)

          1 Reply Last reply Reply Quote 0
          • wssy001
            wssy001 ⭐2021⭐ last edited by wssy001

            你可能需要对JVM下手。搞不好得干掉JVM。我之前试过用GraalVM来编译我的Mirai Core项目(编译成二进制可执行文件),但试验了几天发现它不支持Mirai。
            以下全为我个人猜想↓↓↓
            如果能使用GraalVM编译Mirai且机器人成功登录后,内存(不是硬盘占用,而是RAM占用)占用50MB左右(理想环境:Mac OS 10.14.6 + SpringBoot 2.6.4 + mirai core 2.6.7 + spring-native 0.11.3)

            1 Reply Last reply Reply Quote 0
            • I-love-study
              I-love-study last edited by

              刚刚发现更离谱的
              openj9 64位 的 java 在运行一段时间后内存直接下降到131Mb(要是内存不够可能继续往下降
              hotspot 32位 的 java 则会只下降到 168Mb,维持稳定

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact us