V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
miaeLKK
V2EX  ›  Java

OOM 面试到底怎么回答?

  •  
  •   miaeLKK · Oct 20, 2020 via Android · 3737 views
    This topic created in 2025 days ago, the information mentioned may be changed or developed.

    呃…转行做 java 程序员已经 4 年,确实没遇到过这个问题,最近面试,其他的还好,没想到这个问题被问得颜面扫地,说我不够了解内存模型,确实了解的少…我只说出了堆栈方法区…

    问我如何排查,我说看日志,看代码,看 cpu 使用量,他说要是还有问题呢?我无言了

    所以这个问题该怎么回答?

    8 replies    2020-10-20 20:19:55 +08:00
    miaeLKK
        1
    miaeLKK  
    OP
       Oct 20, 2020
    为什么没看到我写的内容?请允许我重新发一次。。

    呃…转行做 java 程序员已经 4 年,确实没遇到过这个问题,最近面试,其他的还好,没想到这个问题被问得颜面扫地,说我不够了解内存模型,确实了解的少…我只说出了堆栈方法区…

    问我如何排查,我说看日志,看代码,看 cpu 使用量,他说要是还有问题呢?我无言了

    所以这个问题该怎么回答?
    chendy
        2
    chendy  
       Oct 20, 2020
    排查 oom ?
    加参数,oom 的时候 dump 堆,拉下来分析
    chmlai
        3
    chmlai  
       Oct 20, 2020
    找本深入 JVM 的书看看就好了吧
    RedBeanIce
        4
    RedBeanIce  
       Oct 20, 2020   ❤️ 1
    1,启动的时候设置自动打 dump
    2,问题发生时去 dump

    https://www.yuque.com/docs/share/c46d0d0e-5cf8-4d08-b45e-9b3577094395?# 《 outOfMemoryError 》
    miaeLKK
        5
    miaeLKK  
    OP
       Oct 20, 2020 via Android
    @RedBeanIce 这么复杂…话说这些对科班来说都是基础吗…
    RedBeanIce
        6
    RedBeanIce  
       Oct 20, 2020
    @miaeLKK
    5# 不是基础,这是 JVM 扩展,正常来讲,中级左右才会问这些

    需要有前置知识,至少了解 JVM 内存分区,Linux 基础等等。
    Boyce
        7
    Boyce  
       Oct 20, 2020
    我觉得都转行 4 年了,这时候就不需要区分是否是科班了吧。想必没有哪个科班的计算机课程会教如何调试 JAVA 吧。
    xixinimei
        8
    xixinimei  
       Oct 20, 2020
    之前搞 mapreduce 排查过一次。dump 搞出来用 ema 等工具分析一下。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1373 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 23:55 · PVG 07:55 · LAX 16:55 · JFK 19:55
    ♥ Do have faith in what you're doing.