jvm调优工具arthas(阿尔萨斯)安装与使用---实践

jvm调优工具arthas(阿尔萨斯)安装与使用—实践

Arthas 是Alibaba开源的Java诊断工具,深受开发者喜爱。

当你遇到以下类似问题而束手无策时,Arthas可以帮助你解决:

  1. 这个类从哪个 jar 包加载的?为什么会报各种类相关的 Exception?
  2. 我改的代码为什么没有执行到?难道是我没 commit?分支搞错了?
  3. 遇到问题无法在线上 debug,难道只能通过加日志再重新发布吗?
  4. 线上遇到某个用户的数据处理有问题,但线上同样无法 debug,线下无法重现!
  5. 是否有一个全局视角来查看系统的运行状况?
  6. 有什么办法可以监控到JVM的实时运行状态?
  7. 怎么快速定位应用的热点,生成火焰图?
  8. 怎样直接从JVM内查找某个类的实例?

Arthas支持JDK 6+(4.x 版本不再支持 JDK 6 和 JDK 7),支持Linux/Mac/Windows,采用命令行交互模式,同时提供丰富的 Tab 自动补全功能,进一步方便进行问题的定位和诊断。

官方文档

1. 启动 math-game

curl -O https://arthas.aliyun.com/math-game.jar
java -jar math-game.jar

math-game是一个简单的程序,每隔一秒生成一个随机数,再执行质因数分解,并打印出分解结果。

2. 启动 arthas

在命令行下面执行(使用和目标进程一致的用户启动,否则可能 attach 失败):

curl -O https://arthas.aliyun.com/arthas-boot.jar
java -jar arthas-boot.jar
  • 执行该程序的用户需要和目标进程具有相同的权限。比如以admin用户来执行:sudo su admin && java -jar arthas-boot.jarsudo -u admin -EH java -jar arthas-boot.jar
  • 如果 attach 不上目标进程,可以查看~/logs/arthas/ 目录下的日志。
  • 如果下载速度比较慢,可以使用 aliyun 的镜像:java -jar arthas-boot.jar --repo-mirror aliyun --use-http
  • java -jar arthas-boot.jar -h 打印更多参数信息。

选择应用 java 进程:

$ $ java -jar arthas-boot.jar
* [1]: 35542[2]: 71560 math-game.jar

math-game进程是第 2 个,则输入 2,再输入回车/enter。Arthas 会 attach 到目标进程上,并输出日志:

[INFO] Try to attach process 71560
[INFO] Attach process 71560 success.
[INFO] arthas-client connect 127.0.0.1 3658,---.  ,------. ,--------.,--.  ,--.  ,---.   ,---./  O  \ |  .--. ''--.  .--'|  '--'  | /  O  \ '   .-'
|  .-.  ||  '--'.'   |  |   |  .--.  ||  .-.  |`.  `-.
|  | |  ||  |\  \    |  |   |  |  |  ||  | |  |.-'    |
`--' `--'`--' '--'   `--'   `--'  `--'`--' `--'`-----'wiki: https://arthas.aliyun.com/doc
version: 3.0.5.20181127201536
pid: 71560
time: 2018-11-28 19:16:24$

3. 查看 dashboard

输入dashboard,按回车/enter,会展示当前进程的信息,按ctrl+c可以中断执行。

$ dashboard
ID     NAME                   GROUP          PRIORI STATE  %CPU    TIME   INTERRU DAEMON
17     pool-2-thread-1        system         5      WAITIN 67      0:0    false   false
27     Timer-for-arthas-dashb system         10     RUNNAB 32      0:0    false   true
11     AsyncAppender-Worker-a system         9      WAITIN 0       0:0    false   true
9      Attach Listener        system         9      RUNNAB 0       0:0    false   true
3      Finalizer              system         8      WAITIN 0       0:0    false   true
2      Reference Handler      system         10     WAITIN 0       0:0    false   true
4      Signal Dispatcher      system         9      RUNNAB 0       0:0    false   true
26     as-command-execute-dae system         10     TIMED_ 0       0:0    false   true
13     job-timeout            system         9      TIMED_ 0       0:0    false   true
1      main                   main           5      TIMED_ 0       0:0    false   false
14     nioEventLoopGroup-2-1  system         10     RUNNAB 0       0:0    false   false
18     nioEventLoopGroup-2-2  system         10     RUNNAB 0       0:0    false   false
23     nioEventLoopGroup-2-3  system         10     RUNNAB 0       0:0    false   false
15     nioEventLoopGroup-3-1  system         10     RUNNAB 0       0:0    false   false
Memory             used   total max    usage GC
heap               32M    155M  1820M  1.77% gc.ps_scavenge.count  4
ps_eden_space      14M    65M   672M   2.21% gc.ps_scavenge.time(m 166
ps_survivor_space  4M     5M    5M           s)
ps_old_gen         12M    85M   1365M  0.91% gc.ps_marksweep.count 0
nonheap            20M    23M   -1           gc.ps_marksweep.time( 0
code_cache         3M     5M    240M   1.32% ms)
Runtime
os.name                Mac OS X
os.version             10.13.4
java.version           1.8.0_162
java.home              /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre

4. 通过 thread 命令来获取到math-game进程的 Main Class

thread 1会打印线程 ID 1 的栈,通常是 main 函数的线程。

$ thread 1 | grep 'main('at demo.MathGame.main(MathGame.java:17)

5. 通过 jad 来反编译 Main Class

$ jad demo.MathGameClassLoader:
+-sun.misc.Launcher$AppClassLoader@3d4eac69+-sun.misc.Launcher$ExtClassLoader@66350f69Location:
/tmp/math-game.jar/** Decompiled with CFR 0_132.*/
package demo;import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.concurrent.TimeUnit;public class MathGame {private static Random random = new Random();private int illegalArgumentCount = 0;public static void main(String[] args) throws InterruptedException {MathGame game = new MathGame();do {game.run();TimeUnit.SECONDS.sleep(1L);} while (true);}public void run() throws InterruptedException {try {int number = random.nextInt();List<Integer> primeFactors = this.primeFactors(number);MathGame.print(number, primeFactors);}catch (Exception e) {System.out.println(String.format("illegalArgumentCount:%3d, ", this.illegalArgumentCount) + e.getMessage());}}public static void print(int number, List<Integer> primeFactors) {StringBuffer sb = new StringBuffer("" + number + "=");Iterator<Integer> iterator = primeFactors.iterator();while (iterator.hasNext()) {int factor = iterator.next();sb.append(factor).append('*');}if (sb.charAt(sb.length() - 1) == '*') {sb.deleteCharAt(sb.length() - 1);}System.out.println(sb);}public List<Integer> primeFactors(int number) {if (number < 2) {++this.illegalArgumentCount;throw new IllegalArgumentException("number is: " + number + ", need >= 2");}ArrayList<Integer> result = new ArrayList<Integer>();int i = 2;while (i <= number) {if (number % i == 0) {result.add(i);number /= i;i = 2;continue;}++i;}return result;}
}Affect(row-cnt:1) cost in 970 ms.

6. watch

通过watch命令来查看demo.MathGame#primeFactors函数的返回值:

$ watch demo.MathGame primeFactors returnObj
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 107 ms.
ts=2018-11-28 19:22:30; [cost=1.715367ms] result=null
ts=2018-11-28 19:22:31; [cost=0.185203ms] result=null
ts=2018-11-28 19:22:32; [cost=19.012416ms] result=@ArrayList[@Integer[5],@Integer[47],@Integer[2675531],
]
ts=2018-11-28 19:22:33; [cost=0.311395ms] result=@ArrayList[@Integer[2],@Integer[5],@Integer[317],@Integer[503],@Integer[887],
]
ts=2018-11-28 19:22:34; [cost=10.136007ms] result=@ArrayList[@Integer[2],@Integer[2],@Integer[3],@Integer[3],@Integer[31],@Integer[717593],
]
ts=2018-11-28 19:22:35; [cost=29.969732ms] result=@ArrayList[@Integer[5],@Integer[29],@Integer[7651739],
]

7. 退出 arthas

如果只是退出当前的连接,可以用quit或者exit命令。Attach 到目标进程上的 arthas 还会继续运行,端口会保持开放,下次连接时可以直接连接上。

如果想完全退出 arthas,可以执行stop命令。

参考文档

  • 在线教程(推荐)

  • 用户文档

  • 安装

  • 下载

  • 快速入门

  • 进阶使用

  • 命令列表

  • WebConsole

  • Docker

  • Arthas Spring Boot Starter

  • 用户案例

  • FAQ/常见问题

  • 编译调试/参与贡献

  • Release Notes

案例展示

Dashboard
  • https://arthas.aliyun.com/doc/dashboard
Thread
  • https://arthas.aliyun.com/doc/thread

一目了然的了解系统的状态,哪些线程比较占cpu?他们到底在做什么?

$ thread -n 3
"as-command-execute-daemon" Id=29 cpuUsage=75% RUNNABLEat sun.management.ThreadImpl.dumpThreads0(Native Method)at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:440)at com.taobao.arthas.core.command.monitor200.ThreadCommand$1.action(ThreadCommand.java:58)at com.taobao.arthas.core.command.handler.AbstractCommandHandler.execute(AbstractCommandHandler.java:238)at com.taobao.arthas.core.command.handler.DefaultCommandHandler.handleCommand(DefaultCommandHandler.java:67)at com.taobao.arthas.core.server.ArthasServer$4.run(ArthasServer.java:276)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)at java.lang.Thread.run(Thread.java:745)Number of locked synchronizers = 1- java.util.concurrent.ThreadPoolExecutor$Worker@6cd0b6f8"as-session-expire-daemon" Id=25 cpuUsage=24% TIMED_WAITINGat java.lang.Thread.sleep(Native Method)at com.taobao.arthas.core.server.DefaultSessionManager$2.run(DefaultSessionManager.java:85)"Reference Handler" Id=2 cpuUsage=0% WAITING on java.lang.ref.Reference$Lock@69ba0f27at java.lang.Object.wait(Native Method)-  waiting on java.lang.ref.Reference$Lock@69ba0f27at java.lang.Object.wait(Object.java:503)at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
jad
  • https://arthas.aliyun.com/doc/jad

对类进行反编译:

$ jad javax.servlet.ServletClassLoader:
+-java.net.URLClassLoader@6108b2d7+-sun.misc.Launcher$AppClassLoader@18b4aac2+-sun.misc.Launcher$ExtClassLoader@1ddf84b8Location:
/Users/xxx/work/test/lib/servlet-api.jar/** Decompiled with CFR 0_122.*/
package javax.servlet;import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;public interface Servlet {public void init(ServletConfig var1) throws ServletException;public ServletConfig getServletConfig();public void service(ServletRequest var1, ServletResponse var2) throws ServletException, IOException;public String getServletInfo();public void destroy();
}
mc
  • https://arthas.aliyun.com/doc/mc

Memory Compiler/内存编译器,编译.java文件生成.class

mc /tmp/Test.java
retransform
  • https://arthas.aliyun.com/doc/retransform

加载外部的.class文件,retransform 热更新jvm已加载的类。

retransform /tmp/Test.class
retransform -c 327a647b /tmp/Test.class /tmp/Test\$Inner.class
sc
  • https://arthas.aliyun.com/doc/sc

查找JVM中已经加载的类

$ sc -d org.springframework.web.context.support.XmlWebApplicationContextclass-info        org.springframework.web.context.support.XmlWebApplicationContextcode-source       /Users/xxx/work/test/WEB-INF/lib/spring-web-3.2.11.RELEASE.jarname              org.springframework.web.context.support.XmlWebApplicationContextisInterface       falseisAnnotation      falseisEnum            falseisAnonymousClass  falseisArray           falseisLocalClass      falseisMemberClass     falseisPrimitive       falseisSynthetic       falsesimple-name       XmlWebApplicationContextmodifier          publicannotationinterfacessuper-class       +-org.springframework.web.context.support.AbstractRefreshableWebApplicationContext+-org.springframework.context.support.AbstractRefreshableConfigApplicationContext+-org.springframework.context.support.AbstractRefreshableApplicationContext+-org.springframework.context.support.AbstractApplicationContext+-org.springframework.core.io.DefaultResourceLoader+-java.lang.Objectclass-loader      +-org.apache.catalina.loader.ParallelWebappClassLoader+-java.net.URLClassLoader@6108b2d7+-sun.misc.Launcher$AppClassLoader@18b4aac2+-sun.misc.Launcher$ExtClassLoader@1ddf84b8classLoaderHash   25131501
vmtool
  • https://arthas.aliyun.com/doc/vmtool

从JVM heap中获取指定类的实例。

$ vmtool --action getInstances --className java.lang.String --limit 10
@String[][@String[com/taobao/arthas/core/shell/session/Session],@String[com.taobao.arthas.core.shell.session.Session],@String[com/taobao/arthas/core/shell/session/Session],@String[com/taobao/arthas/core/shell/session/Session],@String[com/taobao/arthas/core/shell/session/Session.class],@String[com/taobao/arthas/core/shell/session/Session.class],@String[com/taobao/arthas/core/shell/session/Session.class],@String[com/],@String[java/util/concurrent/ConcurrentHashMap$ValueIterator],@String[java/util/concurrent/locks/LockSupport],
]
stack
  • https://arthas.aliyun.com/doc/stack

查看方法 test.arthas.TestStack#doGet 的调用堆栈:

$ stack test.arthas.TestStack doGet
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 286 ms.
ts=2018-09-18 10:11:45;thread_name=http-bio-8080-exec-10;id=d9;is_daemon=true;priority=5;TCCL=org.apache.catalina.loader.ParallelWebappClassLoader@25131501@test.arthas.TestStack.doGet()at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)...at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:451)at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1121)at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:745)
Trace
  • https://arthas.aliyun.com/doc/trace

观察方法执行的时候哪个子调用比较慢:

Watch
  • https://arthas.aliyun.com/doc/watch

观察方法 test.arthas.TestWatch#doGet 执行的入参,仅当方法抛出异常时才输出。

$ watch test.arthas.TestWatch doGet {params[0], throwExp} -e
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 65 ms.
ts=2018-09-18 10:26:28;result=@ArrayList[@RequestFacade[org.apache.catalina.connector.RequestFacade@79f922b2],@NullPointerException[java.lang.NullPointerException],
]
Monitor
  • https://arthas.aliyun.com/doc/monitor

监控某个特殊方法的调用统计数据,包括总调用次数,平均rt,成功率等信息,每隔5秒输出一次。

$ monitor -c 5 org.apache.dubbo.demo.provider.DemoServiceImpl sayHello
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 109 ms.timestamp            class                                           method    total  success  fail  avg-rt(ms)  fail-rate
----------------------------------------------------------------------------------------------------------------------------2018-09-20 09:45:32  org.apache.dubbo.demo.provider.DemoServiceImpl  sayHello  5      5        0     0.67        0.00%timestamp            class                                           method    total  success  fail  avg-rt(ms)  fail-rate
----------------------------------------------------------------------------------------------------------------------------2018-09-20 09:45:37  org.apache.dubbo.demo.provider.DemoServiceImpl  sayHello  5      5        0     1.00        0.00%timestamp            class                                           method    total  success  fail  avg-rt(ms)  fail-rate
----------------------------------------------------------------------------------------------------------------------------2018-09-20 09:45:42  org.apache.dubbo.demo.provider.DemoServiceImpl  sayHello  5      5        0     0.43        0.00%
Time Tunnel(tt)
  • https://arthas.aliyun.com/doc/tt

记录方法调用信息,支持事后查看方法调用的参数,返回值,抛出的异常等信息,仿佛穿越时空隧道回到调用现场一般。

$ tt -t org.apache.dubbo.demo.provider.DemoServiceImpl sayHello
Press Ctrl+C to abort.
Affect(class-cnt:1 , method-cnt:1) cost in 75 ms.INDEX   TIMESTAMP            COST(ms)  IS-RET  IS-EXP   OBJECT         CLASS                          METHOD
-------------------------------------------------------------------------------------------------------------------------------------1000    2018-09-20 09:54:10  1.971195  true    false    0x55965cca     DemoServiceImpl                sayHello1001    2018-09-20 09:54:11  0.215685  true    false    0x55965cca     DemoServiceImpl                sayHello1002    2018-09-20 09:54:12  0.236303  true    false    0x55965cca     DemoServiceImpl                sayHello1003    2018-09-20 09:54:13  0.159598  true    false    0x55965cca     DemoServiceImpl                sayHello1004    2018-09-20 09:54:14  0.201982  true    false    0x55965cca     DemoServiceImpl                sayHello1005    2018-09-20 09:54:15  0.214205  true    false    0x55965cca     DemoServiceImpl                sayHello1006    2018-09-20 09:54:16  0.241863  true    false    0x55965cca     DemoServiceImpl                sayHello1007    2018-09-20 09:54:17  0.305747  true    false    0x55965cca     DemoServiceImpl                sayHello1008    2018-09-20 09:54:18  0.18468   true    false    0x55965cca     DemoServiceImpl                sayHello
Classloader
  • https://arthas.aliyun.com/doc/classloader

了解当前系统中有多少类加载器,以及每个加载器加载的类数量,帮助您判断是否有类加载器泄露。

$ classloadername                                                  numberOfInstances  loadedCountTotalBootstrapClassLoader                                  1                  3346com.taobao.arthas.agent.ArthasClassloader             1                  1262java.net.URLClassLoader                               2                  1033org.apache.catalina.loader.ParallelWebappClassLoader  1                  628sun.reflect.DelegatingClassLoader                     166                166sun.misc.Launcher$AppClassLoader                      1                  31com.alibaba.fastjson.util.ASMClassLoader              6                  15sun.misc.Launcher$ExtClassLoader                      1                  7org.jvnet.hk2.internal.DelegatingClassLoader          2                  2sun.reflect.misc.MethodUtil                           1                  1
Web Console
  • https://arthas.aliyun.com/doc/web-console

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

Profiler/FlameGraph/火焰图
  • https://arthas.aliyun.com/doc/profiler
$ profiler start
Started [cpu] profiling
$ profiler stop
profiler output file: /tmp/demo/arthas-output/20211207-111550.html
OK

通过浏览器查看profiler结果:

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

Arthas Spring Boot Starter
  • Arthas Spring Boot Starter

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/901807.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

机器学习期末

选择题 以下哪项不是机器学习的类型&#xff1f; A. 监督学习 B.无监督学习 C.半监督学习 D.全监督学习 D 哪一个是机器学习的合理定义? A、机器学习是计算机编程的科学 B、机器学习从标记的数据中学习 C、机器学习是允许机器人智能行动的领域 D、机器学习能使计算机能够在…

3DMAX粒子流样条线生成器PFSpliner使用方法详解

3DMAX粒子流样条线生成器&#xff0c;是一款功能强大且富有创意的工具。它能够为“粒子流源”的每一个粒子生成专属的动画样条线&#xff0c;这些样条线描绘出粒子在空间中的运动轨迹&#xff0c;就如同为粒子绘制出了一条条独特的“运动地图”。更为出色的是&#xff0c;这些样…

Maven中clean、compil等操作介绍和Pom.xml中各个标签介绍

文章目录 前言Maven常用命令1.clean2.vaildate3.compile4.test5.package6.verify7.install8.site9.deploy pom.xml标签详解格式<?xml version"1.0" encoding"UTF-8"?>(xml版本和编码)modelVersion&#xff08;xml版本&#xff09;groupId&#xff…

Centos7.6安装JDK 1.8教程

前提&#xff1a;先把jdk1.8文件上传到usr/local目录下&#xff0c;文件名如&#xff1a;jdk-8u151-linux-x64.tar.gz 1. 解压 JDK 压缩包 假设 jdk-8u151-linux-x64.tar.gz 文件位于 /usr/local 目录下。 进入 /usr/local 目录&#xff1a; cd /usr/local 解压文件&#…

EuroCropsML:首个面向少样本时间序列作物分类的多国基准数据集

2025-04-15&#xff0c;由慕尼黑工业大学等机构创建的 EuroCropsML 数据集&#xff0c;这是一个结合了农民报告的作物数据与 Sentinel-2 卫星观测的时间序列数据集&#xff0c;覆盖了爱沙尼亚、拉脱维亚和葡萄牙。该数据集为解决遥感应用中作物类型数据空间不平衡问题提供了新的…

将python项目打包成Windows后台服务

前文,我开发了一个基于windows11与本地deepseek实现的语音助手,之前是通过CMD直接执行项目的main.py文件。但是这样不适合移植,现在想将其生成一个exe文件,以及部署成windows的后台服务。 关于语音助手的开发与发布,可以看的CSDN文章:一个基于windows11与本地deepseek实…

yolov8复现

Yolov8的复现流程主要包含环境配置、下载源码和验证环境三大步骤&#xff1a; 环境配置 查看电脑状况&#xff1a;通过任务管理器查看电脑是否有独立显卡&#xff08;NVIDIA卡&#xff09;。若有&#xff0c;后续可安装GPU版本的pytorch以加速训练&#xff1b;若没有&#xff0…

Yocto项目实战教程 · 第4章:4.1小节元数据

&#x1f50d; B站相应的视频教程&#xff1a; &#x1f4cc; Yocto项目实战教程-第4章-4.1小节-元数据 记得三连&#xff0c;标为原始粉丝。 在嵌入式Linux系统构建中&#xff0c;Yocto项目凭借其高度模块化、可配置的特性成为主流工具。而其背后的关键支撑之一&#xff0c;便…

《AI大模型应知应会100篇》第23篇:角色扮演技巧:让AI成为你需要的专家

第23篇&#xff1a;角色扮演技巧&#xff1a;让AI成为你需要的专家 摘要 在当今人工智能快速发展的时代&#xff0c;大模型已经不仅仅是简单的问答工具&#xff0c;它们可以通过角色扮演技巧模拟各类专家身份&#xff0c;从而为用户提供更专业、更有针对性的服务。本文将深入探…

Windows系统安装RustDesk Server的详细步骤和客户端设置

Windows系统安装RustDesk Server的详细步骤 在Windows系统上安装RustDesk Server涉及几个关键步骤,包括安装必要的依赖、下载RustDesk Server程序、配置并启动服务。以下是详细的步骤: 1. 安装Node.js和PM2 RustDesk Server的某些版本可能需要Node.js环境来运行,而PM2是一…

如何实现一个构造函数继承另一个构造函数的属性和方法?给出ES5和ES6两种方式

在 JavaScript 中&#xff0c;构造函数继承可以通过 原型链 和 构造函数调用 实现。以下是 ES5 和 ES6 的实现方式&#xff1a; ES5 实现方式 关键步骤 继承实例属性&#xff1a;在子构造函数中调用父构造函数的 call/apply&#xff0c;绑定 this。继承原型方法&#xff1a;将…

AWS Redshift的使用场景及一些常见问题

Redshift 不是关系型数据库, 提供了Amazon Redshift Serverless 和 Amazon Redshift 都是构建于 Redshift 数仓引擎之上的&#xff0c;但它们适用的场景不同。Redshift和Dynamodb都可以存储数据, 分别怎么选择? 这里记录一些常见的问题和场景。 1. 如何选择用Amazon Redshift…

十五种光电器件综合对比——《器件手册--光电器件》

十五、光电器件 名称 原理 特点 应用 发光二极管&#xff08;LED&#xff09; 基于半导体材料的电致发光效应&#xff0c;当电流通过时&#xff0c;电子与空穴复合&#xff0c;释放出光子。 高效、节能、寿命长、响应速度快、体积小。 广泛用于指示灯、照明、显示&#…

Electricity Market Optimization(VI) - 机组组合模型以及 Gurobi 求解

本文参考链接&#xff1a;link \hspace{1.6em} 机组组合问题在电力系统中非常重要&#xff0c;这个问题也是一个优化问题&#xff0c;研究的就是如何调度现有的机组&#xff0c;调度的对象是以煤炭、石油、天然气为燃料的火力发电机以及水力发电机等可预测处理的发电机组&#…

linux多线(进)程编程——(8)多进程的冲突问题

前言 随着时间的推移&#xff0c;共享内存已经在修真界已经沦为禁术。因为使用这种方式沟通的两人往往会陷入到走火入魔的状态&#xff0c;思维扭曲。进程君父子见到这种情况&#xff0c;连忙开始专研起来&#xff0c;终于它们发现了共享内存存在的问题&#xff1a; 进程间冲…

网络层IP协议知识大梳理

全是通俗易懂的讲解&#xff0c;如果你本节之前的知识都掌握清楚&#xff0c;那就速速来看我的IP协议笔记吧~ 自己写自己的八股&#xff01;让未来的自己看懂&#xff01; &#xff08;全文手敲&#xff0c;受益良多&#xff09; 网路基础3 网路层 TCP并没有把数据发到网路…

数据结构与算法学习导航

目录 指导思想资料总结代码随想录hello-algoOI-WIKI 一名麻瓜的刷leetcode的简单概述。 在这里对过去的自己说: 如果你相信算法有用你就刷刷leetcode&#xff0c;如果不相信面试会让你相信。 当然&#xff0c;现在我确实认为算法和数据结构有用&#xff0c;leetcode也有用。 …

【网络安全】谁入侵了我的调制解调器?(二)

文章目录 针对 TR-069 协议 REST API 的攻击思路攻击百万台调制解调器意外发现 Cox 后端 API 的授权绕过漏洞确认我们能够进入任何人的设备访问和更新任何Cox商业客户账户通过泄露的加密密钥覆盖任何人的设备设置执行对任何调制解调器的命令影响最后想说阅读本文前,请先行浏览…

大模型在急性单纯性阑尾炎预测及治疗方案制定中的应用研究

目录 一、引言 1.1 研究背景与意义 1.2 研究目的 1.3 研究方法与创新点 二、急性单纯性阑尾炎概述 2.1 定义与发病机制 2.2 临床表现 2.3 传统诊断方法 三、大模型在急性单纯性阑尾炎预测中的应用 3.1 大模型简介 3.2 数据收集与处理 3.3 模型训练与优化 3.4 预测…

Linux 上安装和配置 VNC 远程桌面

在 Linux 上安装和配置 VNC&#xff08;Virtual Network Computing&#xff09;可以让你远程访问图形化桌面环境。以下是详细的安装和配置步骤&#xff0c;适用于主流 Linux 发行版&#xff08;如 Ubuntu、CentOS、Debian 等&#xff09;。 1. 安装 VNC 服务器 Ubuntu/Debian …