VLCJ:播放1秒后,Java Runtime Environment已检测到致命错误

时间:2019-05-23 14:43:40

标签: java vlcj

这里的代码:

/*
 * This file is part of VLCJ.
 *
 * VLCJ is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * VLCJ is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with VLCJ.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright 2009-2019 Caprica Software Limited.
 */

package uk.co.caprica.vlcjplayer;

import uk.co.caprica.vlcj.factory.MediaPlayerFactory;
import uk.co.caprica.vlcj.player.base.MediaPlayer;
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
import uk.co.caprica.vlcj.player.embedded.videosurface.callback.BufferFormat;
import uk.co.caprica.vlcj.player.embedded.videosurface.callback.BufferFormatCallback;
import uk.co.caprica.vlcj.player.embedded.videosurface.callback.RenderCallback;
import uk.co.caprica.vlcj.player.embedded.videosurface.callback.format.RV32BufferFormat;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationTargetException;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;

/**
 * This simple test player shows how to get direct access to the video frame data.
 * <p>
 * This implementation uses the new (1.1.1) libvlc video call-backs function.
 * <p>
 * Since the video frame data is made available, the Java call-back may modify the contents of the
 * frame if required.
 * <p>
 * The frame data may also be rendered into components such as an OpenGL texture.
 */
public class RtspSubscriber {

    private static RtspSubscriber app;

    // The size does NOT need to match the mediaPlayer size - it's the size that the media will be scaled
    // to - matching the native size will be faster of course
    private final int width = 720;
    private final int height = 480;

    /**
     * Image to render the video frame data.
     */
    // private final BufferedImage image;

    private final MediaPlayerFactory factory;

    private final MediaPlayer mediaPlayer;

    private ImagePane imagePane;
    final String mrl;
    final TestBufferFormatCallback testBufferFormatCallback;
    final TestRenderCallback testRenderCallback;
    BufferedImage image;
    // final Thread t;

    public RtspSubscriber(String media) throws InvocationTargetException, InterruptedException {
        image = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().createCompatibleImage(width, height);
        // image.setAccelerationPriority(1.0f);
        mrl = media;
        factory = new MediaPlayerFactory("--no-video-title-show", "--verbose=3");
        mediaPlayer = factory.mediaPlayers().newEmbeddedMediaPlayer();
        testBufferFormatCallback = new TestBufferFormatCallback();
        testRenderCallback = new TestRenderCallback();
        ((EmbeddedMediaPlayer)mediaPlayer).videoSurface().set(factory.videoSurfaces().newVideoSurface(testBufferFormatCallback, testRenderCallback, true));
        mediaPlayer.media().play(mrl);
    }



    private final int[] rgbBuffer = new int[width * height];

    private final class TestRenderCallback implements RenderCallback {

        // This is not optimal, see the CallbackMediaPlayerComponent for a way to render directly into the raster of a
        // Buffered image

        @Override
        public void display(MediaPlayer mediaPlayer, ByteBuffer[] nativeBuffers, BufferFormat bufferFormat) {
/*
            ByteBuffer bb = nativeBuffers[0];
            IntBuffer ib = bb.asIntBuffer();
            ib.get(rgbBuffer);

            // The image data could be manipulated here...

            // RGB to GRAYScale conversion example

            for (int i=0; i < rgbBuffer.length; i++){
                int argb = rgbBuffer[i];
                int b = (argb & 0xFF);
                int g = ((argb >> 8 ) & 0xFF);
                int r = ((argb >> 16 ) & 0xFF);
                int grey = (r + g + b + g) >> 2 ; // performance optimized - not real grey!
                rgbBuffer[i] = (grey << 16) + (grey << 8) + grey;
            }
*/

            //

            try {
                System.out.println(nativeBuffers.length);
            } catch (Exception e) {
                e.printStackTrace();
            }

            // image.setRGB(0, 0, width, height, rgbBuffer, 0, width);
            //imagePane.repaint();
        }
    }

    private final class TestBufferFormatCallback implements BufferFormatCallback {

        @Override
        public BufferFormat getBufferFormat(int sourceWidth, int sourceHeight) {
            return new RV32BufferFormat(width, height);
        }

    }
}

这是完整的日志:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f440fd49266, pid=26954, tid=0x00007f440c105700
#
# JRE version: OpenJDK Runtime Environment (8.0_212-b03) (build 1.8.0_212-8u212-b03-0ubuntu1.19.04.2-b03)
# Java VM: OpenJDK 64-Bit Server VM (25.212-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x95266]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00007f44080d6000):  JavaThread "Finalizer" daemon [_thread_in_native, id=26977, stack(0x00007f440c005000,0x00007f440c106000)]

siginfo: si_signo: 11 (SIGSEGV), si_code: 128 (SI_KERNEL), si_addr: 0x0000000000000000

Registers:
RAX=0x00007f43787568e0, RBX=0x00007f4378006ae0, RCX=0xffffffffffffffb0, RDX=0x0000000000000000
RSP=0x00007f440c104710, RBP=0xff322b59ff2d2650, RSI=0x0000000000000001, RDI=0xff322b59ff2d263f
R8 =0x0000000000000001, R9 =0x00007f43b2a4eab0, R10=0x00007f43f9351bd1, R11=0x00007f43f934ae00
R12=0x00007f4378000020, R13=0xff32aa9d772d9130, R14=0x0000000000000000, R15=0x00007f44080d6000
RIP=0x00007f440fd49266, EFLAGS=0x0000000000010202, CSGSFS=0x002b000000000033, ERR=0x0000000000000000
  TRAPNO=0x000000000000000d


Instructions: (pc=0x00007f440fd49266)
0x00007f440fd49246:   00 00 49 8b 44 24 60 4c 8d 2c 2b 48 39 d8 0f 84
0x00007f440fd49256:   7e 04 00 00 41 f6 44 24 04 02 0f 84 82 04 00 00
0x00007f440fd49266:   49 8b 45 08 a8 01 0f 84 9e 04 00 00 49 89 c7 49
0x00007f440fd49276:   83 e7 f8 48 83 f8 10 0f 86 7d 03 00 00 4d 39 bc 

Register to memory mapping:

RAX=0x00007f43787568e0 is an unknown value
RBX=0x00007f4378006ae0 is an unknown value
RCX=0xffffffffffffffb0 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x00007f440c104710 is pointing into the stack for thread: 0x00007f44080d6000
RBP=0xff322b59ff2d2650 is an unknown value
RSI=0x0000000000000001 is an unknown value
RDI=0xff322b59ff2d263f is an unknown value
R8 =0x0000000000000001 is an unknown value
R9 =0x00007f43b2a4eab0 is pointing into metadata
R10=0x00007f43f9351bd1 is at entry_point+81 in (nmethod*)0x00007f43f9351a10
R11=0x00007f43f934ae00 is at entry_point+0 in (nmethod*)0x00007f43f934ac90
R12=0x00007f4378000020 is an unknown value
R13=0xff32aa9d772d9130 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x00007f44080d6000 is a thread


Stack: [0x00007f440c005000,0x00007f440c106000],  sp=0x00007f440c104710,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x95266]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 867  com.sun.jna.Native.free(J)V (0 bytes) @ 0x00007f43f9351bd1 [0x00007f43f9351b80+0x51]
J 865 C1 com.sun.jna.Memory.dispose()V (44 bytes) @ 0x00007f43f935955c [0x00007f43f9359360+0x1fc]
J 864 C1 com.sun.jna.Memory.finalize()V (5 bytes) @ 0x00007f43f9358fcc [0x00007f43f9358ec0+0x10c]
J 858 C1 java.lang.ref.Finalizer.runFinalizer(Lsun/misc/JavaLangAccess;)V (62 bytes) @ 0x00007f43f93546ec [0x00007f43f9354100+0x5ec]
J 857 C1 java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;Lsun/misc/JavaLangAccess;)V (6 bytes) @ 0x00007f43f934ae5c [0x00007f43f934ae00+0x5c]
j  java.lang.ref.Finalizer$FinalizerThread.run()V+45
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x00007f438411d000 JavaThread "media-player-events" daemon [_thread_in_native, id=27008, stack(0x00007f4393564000,0x00007f4393d64000)]
  0x00007f43c8001000 JavaThread "Attach Listener" daemon [_thread_blocked, id=26999, stack(0x00007f43b097d000,0x00007f43b0a7e000)]
  0x00007f4398007800 JavaThread "media-player-events" daemon [_thread_in_native, id=26997, stack(0x00007f43b0cb7000,0x00007f43b0db7000)]
  0x00007f44083ce000 JavaThread "process reaper" daemon [_thread_blocked, id=26989, stack(0x00007f43cc02d000,0x00007f43cc066000)]
  0x00007f44083b8800 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=26987, stack(0x00007f43b3523000,0x00007f43b3624000)]
  0x00007f440839d800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=26986, stack(0x00007f43b382a000,0x00007f43b392b000)]
  0x00007f44082a4000 JavaThread "Service Thread" daemon [_thread_blocked, id=26984, stack(0x00007f43ccafa000,0x00007f43ccbfb000)]
  0x00007f44082a1000 JavaThread "C1 CompilerThread2" daemon [_thread_in_native, id=26983, stack(0x00007f43ccbfc000,0x00007f43cccfc000)]
  0x00007f440829f800 JavaThread "C2 CompilerThread1" daemon [_thread_in_vm, id=26982, stack(0x00007f43cfcfe000,0x00007f43cfdfe000)]
  0x00007f440829d000 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=26981, stack(0x00007f43cfdff000,0x00007f43cfeff000)]
  0x00007f440829c000 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=26980, stack(0x00007f43cfeff000,0x00007f43d0000000)]
  0x00007f4408109800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=26979, stack(0x00007f43f8023000,0x00007f43f8124000)]
  0x00007f4408108000 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon [_thread_blocked, id=26978, stack(0x00007f43f8124000,0x00007f43f8225000)]
=>0x00007f44080d6000 JavaThread "Finalizer" daemon [_thread_in_native, id=26977, stack(0x00007f440c005000,0x00007f440c106000)]
  0x00007f44080d3800 JavaThread "Reference Handler" daemon [_thread_blocked, id=26976, stack(0x00007f440c106000,0x00007f440c207000)]
  0x00007f440800d000 JavaThread "main" [_thread_blocked, id=26956, stack(0x00007f440eb5b000,0x00007f440ec5b000)]

Other Threads:
  0x00007f44080ca000 VMThread [stack: 0x00007f440c208000,0x00007f440c308000] [id=26975]
  0x00007f44082a6800 WatcherThread [stack: 0x00007f43cc9fa000,0x00007f43ccafa000] [id=26985]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None


Card table byte_map: [0x00007f440dd56000,0x00007f440e51e000] byte_map_base: 0x00007f440a719000

Marking Bits: (CMSBitMap*) 0x00007f440804c278
 Bits: [0x00007f43f20e3000, 0x00007f43f3fff000)

Mod Union Table: (CMSBitMap*) 0x00007f440804c338
 Bits: [0x00007f440d6f3000, 0x00007f440d76f700)

Polling page: 0x00007f440feb7000

CodeCache: size=245760Kb used=3714Kb max_used=3714Kb free=242045Kb
 bounds [0x00007f43f9000000, 0x00007f43f93b0000, 0x00007f4408000000]
 total_blobs=1424 nmethods=945 adapters=394
 compilation: enabled

Compilation events (10 events):
Event: 7.528 Thread 0x00007f44082a1000 nmethod 936 0x00007f43f938f610 code [0x00007f43f938f780, 0x00007f43f938f928]
Event: 7.528 Thread 0x00007f44082a1000  937       3       java.lang.Thread::init (214 bytes)
Event: 7.533 Thread 0x00007f44082a1000 nmethod 937 0x00007f43f939bbd0 code [0x00007f43f939bf40, 0x00007f43f939e208]
Event: 7.533 Thread 0x00007f44082a1000  938       3       java.nio.Buffer::limit (62 bytes)
Event: 7.534 Thread 0x00007f44082a1000 nmethod 938 0x00007f43f939f390 code [0x00007f43f939f500, 0x00007f43f939f808]
Event: 7.565 Thread 0x00007f44082a1000  940       3       java.security.AccessControlContext::calculateFields (89 bytes)
Event: 7.565 Thread 0x00007f44082a1000 nmethod 940 0x00007f43f939fc50 code [0x00007f43f939fde0, 0x00007f43f93a0198]
Event: 7.707 Thread 0x00007f44082a1000  941   !   3       java.lang.ThreadGroup::add (110 bytes)
Event: 7.708 Thread 0x00007f44082a1000 nmethod 941 0x00007f43f93a02d0 code [0x00007f43f93a04a0, 0x00007f43f93a0df8]
Event: 7.750 Thread 0x00007f440829f800  942   !   4       com.sun.jna.Native::getNativeSize (139 bytes)

GC Heap History (4 events):
Event: 2.790 GC heap before
{Heap before GC invocations=0 (full 0):
 par new generation   total 115200K, used 102400K [0x00000006c7a00000, 0x00000006cf700000, 0x0000000744100000)
  eden space 102400K, 100% used [0x00000006c7a00000, 0x00000006cde00000, 0x00000006cde00000)
  from space 12800K,   0% used [0x00000006cde00000, 0x00000006cde00000, 0x00000006cea80000)
  to   space 12800K,   0% used [0x00000006cea80000, 0x00000006cea80000, 0x00000006cf700000)
 concurrent mark-sweep generation total 128000K, used 0K [0x0000000744100000, 0x000000074be00000, 0x00000007c0800000)
 Metaspace       used 10633K, capacity 11010K, committed 11136K, reserved 1058816K
  class space    used 1219K, capacity 1307K, committed 1408K, reserved 1048576K


7f440ff07000-7f440ff08000 r--p 00029000 08:06 5644030                    /usr/lib/x86_64-linux-gnu/ld-2.29.so
7f440ff08000-7f440ff09000 rw-p 0002a000 08:06 5644030                    /usr/lib/x86_64-linux-gnu/ld-2.29.so
7f440ff09000-7f440ff0a000 rw-p 00000000 00:00 0 
7fffe630a000-7fffe632c000 rw-p 00000000 00:00 0                          [stack]
7fffe63ed000-7fffe63f0000 r--p 00000000 00:00 0                          [vvar]
7fffe63f0000-7fffe63f1000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

VM Arguments:
jvm_args: -XX:+AlwaysPreTouch -XX:+TieredCompilation -XX:NewRatio=1 -XX:+UseConcMarkSweepGC -XX:MaxMetaspaceSize=1024m -XX:ParallelGCThreads=2 -XX:ConcGCThreads=2 -XX:MaxTenuringThreshold=15 -javaagent:/snap/intellij-idea-ultimate/142/lib/idea_rt.jar=41597:/snap/intellij-idea-ultimate/142/bin -Dfile.encoding=UTF-8 
java_command: uk.co.caprica.vlcjplayer.VlcjPlayer
java_class_path (initial): /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/icedtea-sound.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/java-atk-wrapper.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/management-agent.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/home/ravinder/dynapt/vlcj-player/target/classes:/home/ravinder/.m2/repository/com/google/guava/guava/27.1-jre/guava-27.1-jre.jar:/home/ravinder/.m2/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/home/ravinder/.m2/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/home/ravinder/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar:/home/ravinder/.m2/repository/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.jar:/home/ravinder/.m2/repository/com/google/errorprone/error_prone_annotations/2.2.0/error_prone_annotations-2.2.0.jar:/home/ravinder/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar:/home/ravinder/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar:/home/ravinder/.m2/repository/com/miglayout/miglayout-swing/5.2/miglayout-swing-5.2.jar:
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/home/ravinder/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
USERNAME=ravinder
SHELL=/bin/bash
DISPLAY=:0

Signal Handlers:
SIGSEGV: [libjvm.so+0xa1f680], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGBUS: [libjvm.so+0xa1f680], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGFPE: [libjvm.so+0x87ede0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGPIPE: SIG_IGN, sa_mask[0]=00000000000010000000000000000000, sa_flags=SA_RESTART
SIGXFSZ: [libjvm.so+0x87ede0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGILL: [libjvm.so+0x87ede0], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGUSR1: SIG_DFL, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGUSR2: [libjvm.so+0x87ec80], sa_mask[0]=00100000000000000000000000000000, sa_flags=SA_RESTART|SA_SIGINFO
SIGHUP: SIG_IGN, sa_mask[0]=00000000000000000000000000000000, sa_flags=none
SIGINT: [libjvm.so+0x87f060], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGTERM: [libjvm.so+0x87f060], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO
SIGQUIT: [libjvm.so+0x87f060], sa_mask[0]=11111111011111111101111111111110, sa_flags=SA_RESTART|SA_SIGINFO


---------------  S Y S T E M  ---------------

OS:DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=19.04
DISTRIB_CODENAME=disco
DISTRIB_DESCRIPTION="Ubuntu 19.04"

uname:Linux 5.0.0-15-generic #16-Ubuntu SMP Mon May 6 17:41:33 UTC 2019 x86_64
libc:glibc 2.29 NPTL 2.29 
rlimit: STACK 8192k, CORE 0k, NPROC 63494, NOFILE 1048576, AS infinity
load average:2.55 2.39 2.33

/proc/meminfo:
MemTotal:       16303128 kB
MemFree:         4046552 kB
MemAvailable:    9154736 kB
Buffers:          797296 kB
Cached:          4913796 kB
SwapCached:            0 kB
Active:          8050604 kB
Inactive:        3015632 kB
Active(anon):    5634036 kB
Inactive(anon):   394260 kB
Active(file):    2416568 kB
Inactive(file):  2621372 kB
Unevictable:      473448 kB
Mlocked:            1416 kB
SwapTotal:       2097148 kB
SwapFree:        2097148 kB
Dirty:             16988 kB
Writeback:             0 kB
AnonPages:       5828616 kB
Mapped:           869620 kB
Shmem:            673156 kB
KReclaimable:     409308 kB
Slab:             541856 kB
SReclaimable:     409308 kB
SUnreclaim:       132548 kB
KernelStack:       19232 kB
PageTables:        49152 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    10248712 kB
Committed_AS:   16274716 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:             2912 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      300468 kB
DirectMap2M:     9017344 kB
DirectMap1G:     8388608 kB

container (cgroup) information:
container_type: cgroupv1
cpu_cpuset_cpus: 0-3
cpu_memory_nodes: 0
active_processor_count: 4
cpu_quota: -1
cpu_period: 100000
cpu_shares: -1
memory_limit_in_bytes: -1
memory_and_swap_limit_in_bytes: -2
memory_soft_limit_in_bytes: -1
memory_usage_in_bytes: 9462128640
memory_max_usage_in_bytes: 11068043264


CPU:total 4 (initial active 4) (2 cores per cpu, 2 threads per core) family 6 model 78 stepping 3, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, rtm, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx

/proc/cpuinfo:
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 78
model name  : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping    : 3
microcode   : 0xcc
cpu MHz     : 2712.029
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 22
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds
bogomips    : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 78
model name  : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping    : 3
microcode   : 0xcc
cpu MHz     : 2704.461
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 22
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds
bogomips    : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 78
model name  : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping    : 3
microcode   : 0xcc
cpu MHz     : 2718.888
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 22
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds
bogomips    : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 78
model name  : Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
stepping    : 3
microcode   : 0xcc
cpu MHz     : 2715.735
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 3
initial apicid  : 3
fpu     : yes
fpu_exception   : yes
cpuid level : 22
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds
bogomips    : 5616.00
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:



Memory: 4k page, physical 16303128k(4046552k free), swap 2097148k(2097148k free)

vm_info: OpenJDK 64-Bit Server VM (25.212-b03) for linux-amd64 JRE (1.8.0_212-8u212-b03-0ubuntu1.19.04.2-b03), built on Apr 26 2019 01:04:36 by "buildd" with gcc 8.3.0

time: Thu May 23 19:08:00 2019
timezone: IST
elapsed time: 7 seconds (0d 0h 0m 7s)

1 个答案:

答案 0 :(得分:1)

tldr;

在托管回调的类内调用媒体播放器的播放方法后,添加Thread.currentThread().join();。它将以某种方式使线程保持运行状态,防止在任何本机lib错误的情况下由于可执行逻辑的结束而导致执行停止。

经过多次实验或反复试验后,我发现了这一点。

需要其他一些方法来保持应用程序运行,否则在处理流时甚至本机代码中的单个错误都将杀死整个应用程序。我从中获得了自定义渲染器用法示例的实际代码是打开一个jwt Frame,它使应用程序保持打开状态。我删除了它,因为我不需要显示任何内容。但是,现在我开始遇到问题了。正在运行的线程/类没有其他工作了,源自本机lib的任何错误都会中断连接(专家可能在这里使用更好的术语),因此程序将关闭,作为回报,JNI将触发回收垃圾回收的回调对象。

我在创建实例后在类之外使用Thread.currentThread().join();,因此对于托管用于呈现/处理数据的回调的类没有影响。

进一步考虑jwt Frame可能会做什么,我将其删除,并在构造函数内部替换为Thread.currentThread().join();,瞧它开始完美地工作了。