core.memory(std.gc)

本文介绍D语言中垃圾回收器的使用方法,包括如何启用、禁用自动垃圾回收,进行完全收集以及最小化内存占用等操作。此外还详细说明了内存块属性设置与查询的方法,以及各种内存分配与释放函数的使用。
Jump to: memory GC enable disable collect minimize BlkAttr FINALIZE NO_SCAN NO_MOVE BlkInfo getAttr setAttr clrAttr malloc calloc realloc extend reserve free addrOf sizeOf query addRoot addRange removeRoot removeRange
$(DDOC_SECTIONS The memory module provides an interface to the garbage collector and to any other OS or API-level memory management facilities.

$(DDOC_LICENSE struct GC;
This struct encapsulates all garbage collection functionality for the D programming language.

static void enable();
Enables automatic garbage collection behavior if collections have previously been suspended by a call to disable. This function is reentrant, and must be called once for every call to disable before automatic collections are enabled.

static void disable();
Disables automatic garbage collections performed to minimize the process footprint. Collections may continue to occur in instances where the implementation deems necessary for correct program behavior, such as during an out of memory condition. This function is reentrant, but enable must be called once for each call to disable.

static void collect();
Begins a full collection. While the meaning of this may change based on the garbage collector implementation, typical behavior is to scan all stack segments for roots, mark accessible memory blocks as alive, and then to reclaim free space. This action may need to suspend all running threads for at least part of the collection process.

static void minimize();
Indicates that the managed memory space be minimized by returning free physical memory to the operating system. The amount of free memory returned depends on the allocator design and on program behavior.

enum BlkAttr;
Elements for a bit field representing memory block attributes. These are manipulated via the getAttr, setAttr, clrAttr functions.

FINALIZE
Finalize the data in this block on collect.

NO_SCAN
Do not scan through this block on collect.

NO_MOVE
Do not move this memory block on collect.

alias BlkInfo;
Contains aggregate information about a block of managed memory. The purpose of this struct is to support a more efficient query style in instances where detailed information is needed.

base = A pointer to the base of the block in question. size = The size of the block, calculated from base. attr = Attribute bits set on the memory block.

static uint getAttr(void* p);
Returns a bit field representing all block attributes set for the memory referenced by p. If p references memory not originally allocated by this garbage collector, points to the interior of a memory block, or if p is null, zero will be returned.

Parameters:
void* p A pointer to the root of a valid memory block or to null.

Returns:
A bit field containing any bits set for the memory block referenced by p or zero on error.

static uint setAttr(void* p, uint a);
Sets the specified bits for the memory references by p. If p references memory not originally allocated by this garbage collector, points to the interior of a memory block, or if p is null, no action will be performed.

Parameters:
void* p A pointer to the root of a valid memory block or to null.
uint a A bit field containing any bits to set for this memory block.

The result of a call to getAttr after the specified bits have been set.

static uint clrAttr(void* p, uint a);
Clears the specified bits for the memory references by p. If p references memory not originally allocated by this garbage collector, points to the interior of a memory block, or if p is null, no action will be performed.

Parameters:
void* p A pointer to the root of a valid memory block or to null.
uint a A bit field containing any bits to clear for this memory block.

Returns:
The result of a call to getAttr after the specified bits have been cleared.

static void* malloc(size_t sz, uint ba = 0);
Requests an aligned block of managed memory from the garbage collector. This memory may be deleted at will with a call to free, or it may be discarded and cleaned up automatically during a collection run. If allocation fails, this function will call onOutOfMemory which is expected to throw an OutOfMemoryException.

Parameters:
size_t sz The desired allocation size in bytes.
uint ba A bitmask of the attributes to set on this block.

Returns:
A reference to the allocated memory or null if insufficient memory is available.

Throws:
OutOfMemoryException on allocation failure.

static void* calloc(size_t sz, uint ba = 0);
Requests an aligned block of managed memory from the garbage collector, which is initialized with all bits set to zero. This memory may be deleted at will with a call to free, or it may be discarded and cleaned up automatically during a collection run. If allocation fails, this function will call onOutOfMemory which is expected to throw an OutOfMemoryException.

Parameters:
size_t sz The desired allocation size in bytes.
uint ba A bitmask of the attributes to set on this block.

Returns:
A reference to the allocated memory or null if insufficient memory is available.

Throws:
OutOfMemoryException on allocation failure.

static void* realloc(void* p, size_t sz, uint ba = 0);
If sz is zero, the memory referenced by p will be deallocated as if by a call to free. A new memory block of size sz will then be allocated as if by a call to malloc, or the implementation may instead resize the memory block in place. The contents of the new memory block will be the same as the contents of the old memory block, up to the lesser of the new and old sizes. Note that existing memory will only be freed by realloc if sz is equal to zero. The garbage collector is otherwise expected to later reclaim the memory block if it is unused. If allocation fails, this function will call onOutOfMemory which is expected to throw an OutOfMemoryException. If p references memory not originally allocated by this garbage collector, or if it points to the interior of a memory block, no action will be taken. If ba is zero (the default) and p references the head of a valid, known memory block then any bits set on the current block will be set on the new block if a reallocation is required. If ba is not zero and p references the head of a valid, known memory block then the bits in ba will replace those on the current memory block and will also be set on the new block if a reallocation is required.

Parameters:
void* p A pointer to the root of a valid memory block or to null.
size_t sz The desired allocation size in bytes.
uint ba A bitmask of the attributes to set on this block.

Returns:
A reference to the allocated memory on success or null if sz is zero. On failure, the original value of p is returned.

Throws:
OutOfMemoryException on allocation failure.

static size_t extend(void* p, size_t mx, size_t sz);
Requests that the managed memory block referenced by p be extended in place by at least mx bytes, with a desired extension of sz bytes. If an extension of the required size is not possible, if p references memory not originally allocated by this garbage collector, or if p points to the interior of a memory block, no action will be taken.

Parameters:
size_t mx The minimum extension size in bytes.
size_t sz The desired extension size in bytes.

Returns:
The size in bytes of the extended memory block referenced by p or zero if no extension occurred.

static size_t reserve(size_t sz);
Requests that at least sz bytes of memory be obtained from the operating system and marked as free.

Parameters:
size_t sz The desired size in bytes.

Returns:
The actual number of bytes reserved or zero on error.

static void free(void* p);
Deallocates the memory referenced by p. If p is null, no action occurs. If p references memory not originally allocated by this garbage collector, or if it points to the interior of a memory block, no action will be taken. The block will not be finalized regardless of whether the FINALIZE attribute is set. If finalization is desired, use delete instead.

Parameters:
void* p A pointer to the root of a valid memory block or to null.

static void* addrOf(void* p);
Returns the base address of the memory block containing p. This value is useful to determine whether p is an interior pointer, and the result may be passed to routines such as sizeOf which may otherwise fail. If p references memory not originally allocated by this garbage collector, if p is null, or if the garbage collector does not support this operation, null will be returned.

Parameters:
void* p A pointer to the root or the interior of a valid memory block or to null.

Returns:
The base address of the memory block referenced by p or null on error.

static size_t sizeOf(void* p);
Returns the true size of the memory block referenced by p. This value represents the maximum number of bytes for which a call to realloc may resize the existing block in place. If p references memory not originally allocated by this garbage collector, points to the interior of a memory block, or if p is null, zero will be returned.

Parameters:
void* p A pointer to the root of a valid memory block or to null.

Returns:
The size in bytes of the memory block referenced by p or zero on error.

static BlkInfo query(void* p);
Returns aggregate information about the memory block containing p. If p references memory not originally allocated by this garbage collector, if p is null, or if the garbage collector does not support this operation, BlkInfo.init will be returned. Typically, support for this operation is dependent on support for addrOf.

Parameters:
void* p A pointer to the root or the interior of a valid memory block or to null.

Returns:
Information regarding the memory block referenced by p or BlkInfo.init on error.

static void addRoot(void* p);
Adds the memory address referenced by p to an internal list of roots to be scanned during a collection. If p is null, no operation is performed.

Parameters:
void* p A pointer to a valid memory address or to null.

static void addRange(void* p, size_t sz);
Adds the memory block referenced by p and of size sz to an internal list of ranges to be scanned during a collection. If p is null, no operation is performed.

Parameters:
void* p A pointer to a valid memory address or to null.
size_t sz The size in bytes of the block to add. If sz is zero then the no operation will occur. If p is null then sz must be zero.

static void removeRoot(void* p);
Removes the memory block referenced by p from an internal list of roots to be scanned during a collection. If p is null or does not represent a value previously passed to add(void*) then no operation is performed.

p = A pointer to a valid memory address or to null.

static void removeRange(void* p);
Removes the memory block referenced by p from an internal list of ranges to be scanned during a collection. If p is null or does not represent a value previously passed to add(void*, size_t) then no operation is performed.

Parameters:
void* p A pointer to a valid memory address or to null.
分析安卓ANR日志: ----- pid 27068 at 2025-09-01 08:35:45 ----- Cmd line: com.miui.dmregservice Build fingerprint: 'Redmi/gauguinpro/gauguinpro:11/RKQ1.200826.002/V12.5.7.0.RJSCNXM:user/release-keys' ABI: 'arm64' Build type: optimized Zygote loaded classes=15964 post zygote classes=178 Dumping registered class loaders #0 dalvik.system.PathClassLoader: [], parent #1 #1 java.lang.BootClassLoader: [], no parent #2 dalvik.system.PathClassLoader: [/system/framework/tcmclient.jar], parent #0 #3 dalvik.system.PathClassLoader: [], parent #0 #4 dalvik.system.PathClassLoader: [/system/priv-app/DMRegService/DMRegService.apk], parent #1 Done dumping class loaders Classes initialized: 188 in 19.099ms Intern table: 32487 strong; 594 weak JNI: CheckJNI is off; globals=731 (plus 53 weak) Libraries: /system/lib64/libaes-jni.so libandroid.so libaudioeffect_jni.so libcompiler_rt.so libicu_jni.so libjavacore.so libjavacrypto.so libjnigraphics.so libmedia_jni.so libmiuinative.so libopenjdk.so libqti_performance.so librs_jni.so libsfplugin_ccodec.so libsoundpool.so libstats_jni.so libwebviewchromium_loader.so (17) Heap: 0% free, 256MB/256MB; 6743537 objects Dumping cumulative Gc timings Start Dumping histograms for 4377 iterations for concurrent copying MarkingPhase: Sum: 407.621s 99% C.I. 0.377ms-777.999ms Avg: 93.170ms Max: 1311.706ms ProcessMarkStack: Sum: 281.231s 99% C.I. 0.214ms-823.277ms Avg: 64.252ms Max: 2343.286ms ScanCardsForSpace: Sum: 104.203s 99% C.I. 0.084ms-282.336ms Avg: 23.807ms Max: 416.563ms ClearFromSpace: Sum: 26.585s 99% C.I. 0.092ms-33.046ms Avg: 6.073ms Max: 137.219ms ScanImmuneSpaces: Sum: 26.274s 99% C.I. 1.740ms-10.739ms Avg: 3.002ms Max: 38.684ms SweepLargeObjects: Sum: 19.520s 99% C.I. 0.051ms-22.222ms Avg: 4.459ms Max: 52.095ms VisitConcurrentRoots: Sum: 12.732s 99% C.I. 1.017ms-4.789ms Avg: 1.454ms Max: 18.064ms CaptureThreadRootsForMarking: Sum: 10.865s 99% C.I. 0.078ms-24.833ms Avg: 2.483ms Max: 76.475ms EmptyRBMarkBitStack: Sum: 2.792s 99% C.I. 8.791us-16676.800us Avg: 638.100us Max: 131742us InitializePhase: Sum: 1.776s 99% C.I. 81us-1267.625us Avg: 405.784us Max: 2028us SweepSystemWeaks: Sum: 711.284ms 99% C.I. 88us-779.326us Avg: 162.504us Max: 24490us GrayAllDirtyImmuneObjects: Sum: 689.803ms 99% C.I. 90us-558.812us Avg: 157.597us Max: 2826us FlipOtherThreads: Sum: 592.254ms 99% C.I. 51us-563.218us Avg: 135.310us Max: 3265us VisitNonThreadRoots: Sum: 522.591ms 99% C.I. 38us-236us Avg: 59.711us Max: 666us FlipThreadRoots: Sum: 344.754ms 99% C.I. 1.122us-1770.500us Avg: 78.764us Max: 15055us CopyingPhase: Sum: 229.989ms 99% C.I. 4us-2911.500us Avg: 52.544us Max: 20150us ForwardSoftReferences: Sum: 193.330ms 99% C.I. 9us-194.921us Avg: 44.189us Max: 3234us RecordFree: Sum: 154.577ms 99% C.I. 22us-129.250us Avg: 35.315us Max: 4434us MarkZygoteLargeObjects: Sum: 88.839ms 99% C.I. 9us-108.812us Avg: 20.296us Max: 567us ProcessReferences: Sum: 80.408ms 99% C.I. 0.257us-93.589us Avg: 9.185us Max: 1130us ThreadListFlip: Sum: 74.857ms 99% C.I. 5us-97.755us Avg: 17.102us Max: 4208us EnqueueFinalizerReferences: Sum: 71.799ms 99% C.I. 6us-98.390us Avg: 16.403us Max: 239us (Paused)GrayAllNewlyDirtyImmuneObjects: Sum: 66.861ms 99% C.I. 9us-93.130us Avg: 15.275us Max: 3162us ResumeRunnableThreads: Sum: 66.580ms 99% C.I. 1us-127.446us Avg: 15.211us Max: 282us SwapBitmaps: Sum: 65.158ms 99% C.I. 8us-49.932us Avg: 14.886us Max: 206us ReclaimPhase: Sum: 63.089ms 99% C.I. 3us-99.910us Avg: 14.413us Max: 8802us (Paused)SetFromSpace: Sum: 38.540ms 99% C.I. 0.251us-50.442us Avg: 8.805us Max: 370us MarkStackAsLive: Sum: 30.099ms 99% C.I. 2us-49.818us Avg: 6.876us Max: 187us SweepAllocSpace: Sum: 19.862ms 99% C.I. 2us-49.818us Avg: 4.537us Max: 132us (Paused)FlipCallback: Sum: 14.589ms 99% C.I. 1us-49.772us Avg: 3.333us Max: 886us Sweep: Sum: 12.399ms 99% C.I. 1us-49.772us Avg: 2.832us Max: 1245us UnBindBitmaps: Sum: 9.048ms 99% C.I. 1us-45us Avg: 2.067us Max: 45us (Paused)ClearCards: Sum: 7.114ms 99% C.I. 250ns-49758ns Avg: 73ns Max: 2063000ns ResumeOtherThreads: Sum: 4.254ms 99% C.I. 250ns-49852ns Avg: 971ns Max: 217000ns Done Dumping histograms concurrent copying paused: Sum: 213.024ms 99% C.I. 21us-498.296us Avg: 48.668us Max: 4260us concurrent copying freed-bytes: Avg: 72MB Max: 216MB Min: 0B Freed-bytes histogram: 0:731,20480:1518,40960:1123,61440:71,81920:4,143360:1,163840:17,184320:38,204800:874 concurrent copying total time: 897.756s mean time: 205.107ms concurrent copying freed: 4076473440 objects with total size 308GB concurrent copying throughput: 4.54074e+06/s / 351MB/s per cpu-time: 382786808/s / 365MB/s Average major GC reclaim bytes ratio 0.151738 over 4377 GC cycles Average major GC copied live bytes ratio 0.538818 over 4381 major GCs Cumulative bytes moved 56104487208 Cumulative objects moved 1682145047 Peak regions allocated 882 (220MB) / 1024 (256MB) Start Dumping histograms for 4376 iterations for young concurrent copying ProcessMarkStack: Sum: 261.385s 99% C.I. 0.113ms-601.907ms Avg: 59.731ms Max: 847.936ms ScanCardsForSpace: Sum: 124.347s 99% C.I. 0.115ms-443.903ms Avg: 28.415ms Max: 636.348ms ThreadListFlip: Sum: 22.720s 99% C.I. 0.010ms-77.779ms Avg: 5.192ms Max: 85.781ms ScanImmuneSpaces: Sum: 17.205s 99% C.I. 2.067ms-15.023ms Avg: 3.931ms Max: 35.051ms ClearFromSpace: Sum: 11.730s 99% C.I. 0.010ms-17.432ms Avg: 2.680ms Max: 70.950ms VisitConcurrentRoots: Sum: 7.581s 99% C.I. 1.018ms-6.003ms Avg: 1.732ms Max: 14.137ms SweepArray: Sum: 1.623s 99% C.I. 3us-6965.333us Avg: 370.912us Max: 12241us InitializePhase: Sum: 1.593s 99% C.I. 152us-1192.166us Avg: 364.035us Max: 11618us EmptyRBMarkBitStack: Sum: 1.533s 99% C.I. 4.206us-13624us Avg: 350.345us Max: 50705us GrayAllDirtyImmuneObjects: Sum: 906.267ms 99% C.I. 112us-660.599us Avg: 207.099us Max: 3455us FlipOtherThreads: Sum: 817.301ms 99% C.I. 80us-736.959us Avg: 186.768us Max: 10146us SweepSystemWeaks: Sum: 761.883ms 99% C.I. 100.090us-679.428us Avg: 174.104us Max: 2980us CopyingPhase: Sum: 737.008ms 99% C.I. 5us-5792us Avg: 168.420us Max: 78766us FlipThreadRoots: Sum: 481.351ms 99% C.I. 1.161us-3208us Avg: 109.997us Max: 10801us VisitNonThreadRoots: Sum: 322.082ms 99% C.I. 40us-311.777us Avg: 73.601us Max: 2963us RecordFree: Sum: 159.366ms 99% C.I. 0.271us-129.471us Avg: 18.209us Max: 1091us ResumeRunnableThreads: Sum: 103.752ms 99% C.I. 1us-187.172us Avg: 23.709us Max: 5880us ProcessReferences: Sum: 88.833ms 99% C.I. 0.259us-95.092us Avg: 10.150us Max: 935us (Paused)GrayAllNewlyDirtyImmuneObjects: Sum: 87.416ms 99% C.I. 9us-105.888us Avg: 19.976us Max: 1337us EnqueueFinalizerReferences: Sum: 71.267ms 99% C.I. 6us-98.344us Avg: 16.285us Max: 826us MarkZygoteLargeObjects: Sum: 41.806ms 99% C.I. 3us-61.636us Avg: 9.553us Max: 1184us (Paused)SetFromSpace: Sum: 41.763ms 99% C.I. 0.254us-124.486us Avg: 9.543us Max: 1634us ReclaimPhase: Sum: 41.210ms 99% C.I. 3us-95.523us Avg: 9.417us Max: 1722us ForwardSoftReferences: Sum: 39.831ms 99% C.I. 3us-49.955us Avg: 9.102us Max: 3182us SwapBitmaps: Sum: 33.890ms 99% C.I. 4us-49.863us Avg: 7.744us Max: 171us ResetStack: Sum: 31.634ms 99% C.I. 2us-49.932us Avg: 7.228us Max: 931us UnBindBitmaps: Sum: 21.586ms 99% C.I. 2us-49.806us Avg: 4.932us Max: 306us (Paused)FlipCallback: Sum: 15.990ms 99% C.I. 1us-49.852us Avg: 3.654us Max: 164us (Paused)ClearCards: Sum: 11.024ms 99% C.I. 250ns-49769ns Avg: 114ns Max: 1858000ns ResumeOtherThreads: Sum: 5.534ms 99% C.I. 0.250us-49.784us Avg: 1.264us Max: 112us FreeList: Sum: 1.634ms 99% C.I. 0.250us-25us Avg: 1.638us Max: 25us Done Dumping histograms young concurrent copying paused: Sum: 22.887s 99% C.I. 0.025ms-77.186ms Avg: 5.230ms Max: 85.832ms young concurrent copying freed-bytes: Avg: 8982KB Max: 90MB Min: 0B Freed-bytes histogram: 0:2931,10240:749,20480:558,30720:38,40960:60,51200:37,61440:2,92160:1 young concurrent copying total time: 454.543s mean time: 103.871ms young concurrent copying freed: 863768394 objects with total size 37GB young concurrent copying throughput: 1.9003e+06/s / 84MB/s per cpu-time: 96565942/s / 92MB/s Average minor GC reclaim bytes ratio 0.0578315 over 4376 GC cycles Average minor GC copied live bytes ratio 0.351063 over 4376 minor GCs Cumulative bytes moved 49489427536 Cumulative objects moved 1508266327 Peak regions allocated 882 (220MB) / 1024 (256MB) Total time spent in GC: 1352.299s Mean GC size throughput: 261MB/s per cpu-time: 276MB/s Mean GC object throughput: 3.65322e+06 objects/s Total number of allocations 4946979908 Total bytes allocated 345GB Total bytes freed 345GB Free memory 55KB Free memory until GC 55KB Free memory until OOME 55KB Total memory 256MB Max memory 256MB Zygote space size 3556KB Total mutator paused time: 23.100s Total time waiting for GC to complete: 394.162s Total GC count: 8759 Total GC time: 1358.123s Total blocking GC count: 3623 Total blocking GC time: 533.131s Histogram of GC count per 10000 ms: 0:3137,1:9,2:3,3:7,4:14,5:8,6:11,7:9,8:157,9:13,10:376,11:28,12:19,13:27,14:32,15:20,16:19,17:17,18:12,19:5,20:41 Histogram of blocking GC count per 10000 ms: 0:3164,1:6,2:9,3:117,4:469,5:57,6:14,7:40,8:81,9:5,10:1,14:1 Native bytes total: 14255852 registered: 54108 Total native bytes at last GC: 14256364 /system/framework/oat/arm64/android.hidl.base-V1.0-java.odex: quicken /system/framework/oat/arm64/android.hidl.manager-V1.0-java.odex: quicken /system/framework/oat/arm64/android.test.base.odex: quicken /system/framework/oat/arm64/org.apache.http.legacy.odex: speed-profile /data/dalvik-cache/arm64/system@priv-app@DMRegService@DMRegService.apk@classes.dex: speed Current JIT code cache size (used / resident): 19KB / 32KB Current JIT data cache size (used / resident): 22KB / 32KB Zygote JIT code cache size (at point of fork): 59KB / 64KB Zygote JIT data cache size (at point of fork): 53KB / 60KB Current JIT mini-debug-info size: 51KB Current JIT capacity: 64KB Current number of JIT JNI stub entries: 0 Current number of JIT code cache entries: 73 Total number of JIT compilations: 27 Total number of JIT compilations for on stack replacement: 0 Total number of JIT code cache collections: 0 Memory used for stack maps: Avg: 152B Max: 1208B Min: 24B Memory used for compiled code: Avg: 745B Max: 4652B Min: 112B Memory used for profiling info: Avg: 207B Max: 2096B Min: 32B Start Dumping histograms for 73 iterations for JIT timings Compiling: Sum: 195.105ms 99% C.I. 0.372ms-16.458ms Avg: 2.672ms Max: 20.238ms TrimMaps: Sum: 5.313ms 99% C.I. 17us-395.250us Avg: 72.780us Max: 405us Done Dumping histograms Memory used for compilation: Avg: 147KB Max: 837KB Min: 16KB suspend all histogram: Sum: 22.745s 99% C.I. 0.011ms-43.325ms Avg: 2.593ms Max: 85.769ms DALVIK THREADS (33): "Signal Catcher" daemon prio=10 tid=6 Runnable | group="system" sCount=0 dsCount=0 flags=0 obj=0x12c401f8 self=0xb400006f78638000 | sysTid=27078 nice=-20 cgrp=default sched=0/0 handle=0x6f7996bcc0 | state=R schedstat=( 26959839 1784165 23 ) utm=1 stm=0 core=0 HZ=100 | stack=0x6f79874000-0x6f79876000 stackSize=995KB | held mutexes= "mutator lock"(shared held) native: #00 pc 00000000004a0c68 /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+140) native: #01 pc 00000000005ae000 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+376) native: #02 pc 00000000005cb13c /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+924) native: #03 pc 00000000005c507c /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+528) native: #04 pc 00000000005c4208 /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+1920) native: #05 pc 00000000005c36a8 /apex/com.android.art/lib64/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+776) native: #06 pc 000000000056f5f8 /apex/com.android.art/lib64/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)+196) native: #07 pc 0000000000584c38 /apex/com.android.art/lib64/libart.so (art::SignalCatcher::HandleSigQuit()+1396) native: #08 pc 0000000000583c04 /apex/com.android.art/lib64/libart.so (art::SignalCatcher::Run(void*)+348) native: #09 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #10 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "main" prio=5 tid=1 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x72caf308 self=0xb40000700ea2dc00 | sysTid=27068 nice=0 cgrp=default sched=0/0 handle=0x701017f4f8 | state=S schedstat=( 4316685794 1721568040 9042 ) utm=222 stm=209 core=1 HZ=100 | stack=0x7ff4c7b000-0x7ff4c7d000 stackSize=8192KB | held mutexes= native: #00 pc 00000000000d7a58 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8) native: #01 pc 0000000000019acc /system/lib64/libutils.so (android::Looper::pollInner(int)+184) native: #02 pc 00000000000199ac /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) native: #03 pc 0000000000118288 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) at android.os.MessageQueue.nativePollOnce(Native method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:8059) at java.lang.reflect.Method.invoke(Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) "Runtime worker thread 0" prio=10 tid=2 Native (still starting up) | group="" sCount=1 dsCount=0 flags=1 obj=0x0 self=0xb400006f78600000 | sysTid=27074 nice=-20 cgrp=default sched=0/0 handle=0x700ec6ad00 | state=S schedstat=( 220052 7604 4 ) utm=0 stm=0 core=6 HZ=100 | stack=0x700ec5c000-0x700ec5e000 stackSize=63KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000005cce64 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+120) native: #03 pc 00000000005cc0c8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()+80) native: #04 pc 00000000005cbbd8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+192) native: #05 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #06 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Runtime worker thread 2" prio=10 tid=3 Native (still starting up) | group="" sCount=1 dsCount=0 flags=1 obj=0x0 self=0xb40000700ea2f800 | sysTid=27076 nice=-20 cgrp=default sched=0/0 handle=0x700cdf6d00 | state=S schedstat=( 87239 32865 3 ) utm=0 stm=0 core=6 HZ=100 | stack=0x700cde8000-0x700cdea000 stackSize=63KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000005cce64 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+120) native: #03 pc 00000000005cc0c8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()+80) native: #04 pc 00000000005cbbd8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+192) native: #05 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #06 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Runtime worker thread 1" prio=10 tid=4 Native (still starting up) | group="" sCount=1 dsCount=0 flags=1 obj=0x0 self=0xb400006f78611800 | sysTid=27075 nice=-20 cgrp=default sched=0/0 handle=0x700ce46d00 | state=S schedstat=( 76147 137395 4 ) utm=0 stm=0 core=6 HZ=100 | stack=0x700ce38000-0x700ce3a000 stackSize=63KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000005cce64 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+120) native: #03 pc 00000000005cc0c8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()+80) native: #04 pc 00000000005cbbd8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+192) native: #05 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #06 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Runtime worker thread 3" prio=10 tid=5 Native (still starting up) | group="" sCount=1 dsCount=0 flags=1 obj=0x0 self=0xb400006f6bbd2c00 | sysTid=27077 nice=-20 cgrp=default sched=0/0 handle=0x6f88965d00 | state=S schedstat=( 49948 69739 2 ) utm=0 stm=0 core=6 HZ=100 | stack=0x6f88957000-0x6f88959000 stackSize=63KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000005cce64 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+120) native: #03 pc 00000000005cc0c8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()+80) native: #04 pc 00000000005cbbd8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+192) native: #05 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #06 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Jit thread pool worker thread 0" daemon prio=5 tid=7 Native | group="system" sCount=1 dsCount=0 flags=1 obj=0x12c40270 self=0xb400006f6bbf5c00 | sysTid=27079 nice=0 cgrp=default sched=0/0 handle=0x6f79871d00 | state=S schedstat=( 62065363 11169270 36 ) utm=5 stm=0 core=2 HZ=100 | stack=0x6f79773000-0x6f79775000 stackSize=1023KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000005cce64 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+120) native: #03 pc 00000000005cc108 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()+144) native: #04 pc 00000000005cbbd8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+192) native: #05 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #06 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "HeapTaskDaemon" daemon prio=5 tid=8 WaitingForGcToComplete | group="system" sCount=1 dsCount=0 flags=1 obj=0x12c402e8 self=0xb400006f6bbe4400 | sysTid=27080 nice=4 cgrp=default sched=0/0 handle=0x6f7976ccc0 | state=S schedstat=( 1129937649897 21627716205 99260 ) utm=103605 stm=9388 core=0 HZ=100 | stack=0x6f79669000-0x6f7966b000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002a9074 /apex/com.android.art/lib64/libart.so (art::gc::Heap::ConcurrentGC(art::Thread*, art::gc::GcCause, bool)+68) native: #05 pc 00000000002aeb60 /apex/com.android.art/lib64/libart.so (art::gc::Heap::ConcurrentGCTask::Run(art::Thread*)+36) native: #06 pc 00000000002e78a8 /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+64) at dalvik.system.VMRuntime.runHeapTasks(Native method) at java.lang.Daemons$HeapTaskDaemon.runInternal(Daemons.java:532) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:923) "ReferenceQueueDaemon" daemon prio=5 tid=9 Waiting | group="system" sCount=1 dsCount=0 flags=1 obj=0x12c40360 self=0xb400006f6bbe6000 | sysTid=27081 nice=4 cgrp=default sched=0/0 handle=0x6f79662cc0 | state=S schedstat=( 950002953 409741723 8979 ) utm=36 stm=58 core=0 HZ=100 | stack=0x6f7955f000-0x6f79561000 stackSize=1043KB | held mutexes= at java.lang.Object.wait(Native method) - waiting on <0x03778e03> (a java.lang.Class<java.lang.ref.ReferenceQueue>) at java.lang.Object.wait(Object.java:442) at java.lang.Object.wait(Object.java:568) at java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:218) - locked <0x03778e03> (a java.lang.Class<java.lang.ref.ReferenceQueue>) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:923) "FinalizerDaemon" daemon prio=5 tid=10 Waiting | group="system" sCount=1 dsCount=0 flags=1 obj=0x12c403d8 self=0xb400006f6bbe7c00 | sysTid=27082 nice=4 cgrp=default sched=0/0 handle=0x6f79558cc0 | state=S schedstat=( 4083230504 452801530 9278 ) utm=353 stm=54 core=4 HZ=100 | stack=0x6f79455000-0x6f79457000 stackSize=1043KB | held mutexes= at java.lang.Object.wait(Native method) - waiting on <0x007e9180> (a java.lang.Object) at java.lang.Object.wait(Object.java:442) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190) - locked <0x007e9180> (a java.lang.Object) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:274) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:923) "FinalizerWatchdogDaemon" daemon prio=5 tid=11 Sleeping | group="system" sCount=1 dsCount=0 flags=1 obj=0x12c404a0 self=0xb400006f6bbe9800 | sysTid=27083 nice=4 cgrp=default sched=0/0 handle=0x6f7944ecc0 | state=S schedstat=( 57866405 24556871 655 ) utm=4 stm=0 core=1 HZ=100 | stack=0x6f7934b000-0x6f7934d000 stackSize=1043KB | held mutexes= at java.lang.Thread.sleep(Native method) - sleeping on <0x0f3923b9> (a java.lang.Object) at java.lang.Thread.sleep(Thread.java:442) - locked <0x0f3923b9> (a java.lang.Object) at java.lang.Thread.sleep(Thread.java:358) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepForNanos(Daemons.java:391) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:420) at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:326) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:923) "Binder:27068_1" prio=5 tid=12 WaitingForCheckPointsToRun | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40520 self=0xb400006f78653800 | sysTid=27084 nice=0 cgrp=default sched=0/0 handle=0x6f79246cc0 | state=S schedstat=( 1843666204 549965140 1728 ) utm=167 stm=17 core=5 HZ=100 | stack=0x6f7914f000-0x6f79151000 stackSize=995KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000001abe58 /apex/com.android.art/lib64/libart.so (void art::Barrier::Increment<(art::Barrier::LockHandling)1>(art::Thread*, int)+80) native: #03 pc 000000000025ae44 /apex/com.android.art/lib64/libart.so (art::gc::collector::ConcurrentCopying::CaptureThreadRootsForMarking()+876) native: #04 pc 0000000000255134 /apex/com.android.art/lib64/libart.so (art::gc::collector::ConcurrentCopying::MarkingPhase()+1196) native: #05 pc 0000000000254320 /apex/com.android.art/lib64/libart.so (art::gc::collector::ConcurrentCopying::RunPhases()+240) native: #06 pc 0000000000278bc0 /apex/com.android.art/lib64/libart.so (art::gc::collector::GarbageCollector::Run(art::gc::GcCause, bool)+300) native: #07 pc 00000000002959d4 /apex/com.android.art/lib64/libart.so (art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool)+4144) native: #08 pc 0000000000299fdc /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+2484) native: #09 pc 000000000065a37c /apex/com.android.art/lib64/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+396) native: #10 pc 000000000013bb78 /apex/com.android.art/lib64/libart.so (art_quick_alloc_object_initialized_region_tlab+104) at android.os.ThreadLocalWorkSource.setUid(ThreadLocalWorkSource.java:68) at android.os.Binder.execTransact(Binder.java:1124) "Binder:27068_2" prio=5 tid=13 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c405b8 self=0xb400006f6bc0c400 | sysTid=27085 nice=0 cgrp=default sched=0/0 handle=0x6f79148cc0 | state=S schedstat=( 2137657 4381250 13 ) utm=0 stm=0 core=5 HZ=100 | stack=0x6f79051000-0x6f79053000 stackSize=995KB | held mutexes= native: #00 pc 00000000000d6a94 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4) native: #01 pc 00000000000935c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156) native: #02 pc 0000000000051a7c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+296) native: #03 pc 0000000000051c6c /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24) native: #04 pc 0000000000052528 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60) native: #05 pc 0000000000078630 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24) native: #06 pc 00000000000154cc /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) native: #07 pc 00000000000a5694 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) native: #08 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) native: #09 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #10 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Binder:27068_3" prio=5 tid=14 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40630 self=0xb400006f7866a000 | sysTid=27086 nice=0 cgrp=default sched=0/0 handle=0x6f7904acc0 | state=S schedstat=( 1382571254 1513631999 4854 ) utm=87 stm=51 core=1 HZ=100 | stack=0x6f78f53000-0x6f78f55000 stackSize=995KB | held mutexes= native: #00 pc 00000000000d6a94 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4) native: #01 pc 00000000000935c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156) native: #02 pc 0000000000051a7c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+296) native: #03 pc 0000000000051c6c /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24) native: #04 pc 0000000000052528 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60) native: #05 pc 0000000000078630 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24) native: #06 pc 00000000000154cc /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) native: #07 pc 00000000000a5694 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) native: #08 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) native: #09 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #10 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "HwBinder:27068_1" prio=5 tid=15 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c406a8 self=0xb400006f6bbeb400 | sysTid=27088 nice=0 cgrp=default sched=0/0 handle=0x6f73efdcc0 | state=S schedstat=( 198333 1771 2 ) utm=0 stm=0 core=7 HZ=100 | stack=0x6f73e06000-0x6f73e08000 stackSize=995KB | held mutexes= native: #00 pc 00000000000d6a94 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4) native: #01 pc 00000000000935c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156) native: #02 pc 0000000000086570 /system/lib64/libhidlbase.so (android::hardware::IPCThreadState::getAndExecuteCommand()+172) native: #03 pc 0000000000087b40 /system/lib64/libhidlbase.so (android::hardware::IPCThreadState::joinThreadPool(bool)+96) native: #04 pc 0000000000096d64 /system/lib64/libhidlbase.so (android::hardware::PoolThread::threadLoop()+24) native: #05 pc 00000000000154cc /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) native: #06 pc 00000000000a5694 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) native: #07 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) native: #08 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #09 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "WifiManagerThread" prio=5 tid=16 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40720 self=0xb400006f6bbed000 | sysTid=27089 nice=0 cgrp=default sched=0/0 handle=0x6f73dffcc0 | state=S schedstat=( 178230 0 1 ) utm=0 stm=0 core=6 HZ=100 | stack=0x6f73cfc000-0x6f73cfe000 stackSize=1043KB | held mutexes= native: #00 pc 00000000000d7a58 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8) native: #01 pc 0000000000019acc /system/lib64/libutils.so (android::Looper::pollInner(int)+184) native: #02 pc 00000000000199ac /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) native: #03 pc 0000000000118288 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) at android.os.MessageQueue.nativePollOnce(Native method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:193) at android.os.HandlerThread.run(HandlerThread.java:67) "Binder:27068_4" prio=5 tid=17 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40808 self=0xb400006f6bd35800 | sysTid=27090 nice=0 cgrp=default sched=0/0 handle=0x6f73cf5cc0 | state=S schedstat=( 29694731 38369428 120 ) utm=1 stm=1 core=2 HZ=100 | stack=0x6f73bfe000-0x6f73c00000 stackSize=995KB | held mutexes= native: #00 pc 00000000000d6a94 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4) native: #01 pc 00000000000935c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156) native: #02 pc 0000000000051a7c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+296) native: #03 pc 0000000000051c6c /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24) native: #04 pc 0000000000052528 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60) native: #05 pc 0000000000078630 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24) native: #06 pc 00000000000154cc /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) native: #07 pc 00000000000a5694 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) native: #08 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) native: #09 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #10 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "pool-2-thread-1" prio=5 tid=18 Waiting | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40b20 self=0xb400006f6bbeec00 | sysTid=27091 nice=0 cgrp=default sched=0/0 handle=0x6f1d7d4cc0 | state=S schedstat=( 1886353 692657 4 ) utm=0 stm=0 core=6 HZ=100 | stack=0x6f1d6d1000-0x6f1d6d3000 stackSize=1043KB | held mutexes= at sun.misc.Unsafe.park(Native method) - waiting on an unknown object at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-1" prio=5 tid=22 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40c90 self=0xb400006f6bdc2c00 | sysTid=27114 nice=0 cgrp=default sched=0/0 handle=0x6f1938ccc0 | state=S schedstat=( 204513501403 2427662953 22019 ) utm=17722 stm=2729 core=2 HZ=100 | stack=0x6f19289000-0x6f1928b000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 00000000004c11a8 /apex/com.android.art/lib64/libart.so (art::mirror::Object* art::gc::Heap::AllocObjectWithAllocator<true, true, art::mirror::SetStringCountAndValueVisitorFromString>(art::Thread*, art::ObjPtr<art::mirror::Class>, unsigned long, art::gc::AllocatorType, art::mirror::SetStringCountAndValueVisitorFromString const&)+1872) native: #06 pc 00000000004c0618 /apex/com.android.art/lib64/libart.so (art::String_fastSubstring(_JNIEnv*, _jobject*, int, int)+396) at java.lang.String.fastSubstring(Native method) at java.lang.String.substring(String.java:2069) at org.json.JSONTokener.nextString(JSONTokener.java:214) at org.json.JSONTokener.nextValue(JSONTokener.java:111) at org.json.JSONTokener.readObject(JSONTokener.java:371) at org.json.JSONTokener.nextValue(JSONTokener.java:104) at org.json.JSONTokener.readArray(JSONTokener.java:440) at org.json.JSONTokener.nextValue(JSONTokener.java:107) at org.json.JSONTokener.readObject(JSONTokener.java:394) at org.json.JSONTokener.nextValue(JSONTokener.java:104) at org.json.JSONObject.<init>(JSONObject.java:165) at org.json.JSONObject.<init>(JSONObject.java:182) at cn.richinfo.dm.business.a.a(:-1) at cn.richinfo.dm.service.f.run(:-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-2" prio=5 tid=19 Waiting | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40e00 self=0xb400006f6bdc4800 | sysTid=27116 nice=0 cgrp=default sched=0/0 handle=0x6f1c6cacc0 | state=S schedstat=( 204866699204 2309068900 20936 ) utm=17673 stm=2813 core=1 HZ=100 | stack=0x6f1c5c7000-0x6f1c5c9000 stackSize=1043KB | held mutexes= at sun.misc.Unsafe.park(Native method) - waiting on an unknown object at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-4" prio=5 tid=20 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c40ec8 self=0xb400006f6bdc8000 | sysTid=27118 nice=0 cgrp=default sched=0/0 handle=0x6f1b496cc0 | state=S schedstat=( 204828084909 2819158662 21878 ) utm=17777 stm=2705 core=2 HZ=100 | stack=0x6f1b393000-0x6f1b395000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 00000000004c11a8 /apex/com.android.art/lib64/libart.so (art::mirror::Object* art::gc::Heap::AllocObjectWithAllocator<true, true, art::mirror::SetStringCountAndValueVisitorFromString>(art::Thread*, art::ObjPtr<art::mirror::Class>, unsigned long, art::gc::AllocatorType, art::mirror::SetStringCountAndValueVisitorFromString const&)+1872) native: #06 pc 00000000004c0618 /apex/com.android.art/lib64/libart.so (art::String_fastSubstring(_JNIEnv*, _jobject*, int, int)+396) at java.lang.String.fastSubstring(Native method) at java.lang.String.substring(String.java:2069) at org.json.JSONTokener.nextString(JSONTokener.java:214) at org.json.JSONTokener.nextValue(JSONTokener.java:111) at org.json.JSONTokener.readObject(JSONTokener.java:394) at org.json.JSONTokener.nextValue(JSONTokener.java:104) at org.json.JSONTokener.readArray(JSONTokener.java:440) at org.json.JSONTokener.nextValue(JSONTokener.java:107) at org.json.JSONTokener.readObject(JSONTokener.java:394) at org.json.JSONTokener.nextValue(JSONTokener.java:104) at org.json.JSONObject.<init>(JSONObject.java:165) at org.json.JSONObject.<init>(JSONObject.java:182) at cn.richinfo.dm.business.a.a(:-1) at cn.richinfo.dm.service.f.run(:-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-3" prio=5 tid=21 Waiting | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c413d8 self=0xb400006f6bdc6400 | sysTid=27117 nice=0 cgrp=default sched=0/0 handle=0x6f1b5a0cc0 | state=S schedstat=( 201102023433 2507016647 21137 ) utm=17463 stm=2647 core=5 HZ=100 | stack=0x6f1b49d000-0x6f1b49f000 stackSize=1043KB | held mutexes= at sun.misc.Unsafe.park(Native method) - waiting on an unknown object at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-6" prio=5 tid=24 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c414a0 self=0xb400006f6bdd0c00 | sysTid=27226 nice=0 cgrp=default sched=0/0 handle=0x6f1606ecc0 | state=S schedstat=( 207521618734 4234405161 21755 ) utm=17983 stm=2768 core=1 HZ=100 | stack=0x6f15f6b000-0x6f15f6d000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 000000000065a37c /apex/com.android.art/lib64/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+396) native: #06 pc 000000000013bb78 /apex/com.android.art/lib64/libart.so (art_quick_alloc_object_initialized_region_tlab+104) at java.util.LinkedHashMap.entrySet(LinkedHashMap.java:670) at org.json.JSONObject.writeTo(JSONObject.java:733) at org.json.JSONStringer.value(JSONStringer.java:246) at org.json.JSONArray.writeTo(JSONArray.java:616) at org.json.JSONStringer.value(JSONStringer.java:242) at org.json.JSONObject.writeTo(JSONObject.java:734) at org.json.JSONObject.toString(JSONObject.java:702) at cn.richinfo.dm.business.a.a(:-1) at cn.richinfo.dm.service.f.run(:-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-7" prio=5 tid=25 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c41670 self=0xb400006f6bdc1000 | sysTid=27250 nice=0 cgrp=default sched=0/0 handle=0x6f16178cc0 | state=S schedstat=( 212465331917 4054930191 23028 ) utm=18456 stm=2790 core=0 HZ=100 | stack=0x6f16075000-0x6f16077000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 000000000065a37c /apex/com.android.art/lib64/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+396) native: #06 pc 000000000013bb78 /apex/com.android.art/lib64/libart.so (art_quick_alloc_object_initialized_region_tlab+104) at java.util.LinkedHashMap.newNode(LinkedHashMap.java:280) at java.util.HashMap.putVal(HashMap.java:630) at java.util.HashMap.put(HashMap.java:611) at org.json.JSONObject.put(JSONObject.java:273) at org.json.JSONTokener.readObject(JSONTokener.java:394) at org.json.JSONTokener.nextValue(JSONTokener.java:104) at org.json.JSONTokener.readArray(JSONTokener.java:440) at org.json.JSONTokener.nextValue(JSONTokener.java:107) at org.json.JSONTokener.readObject(JSONTokener.java:394) at org.json.JSONTokener.nextValue(JSONTokener.java:104) at org.json.JSONObject.<init>(JSONObject.java:165) at org.json.JSONObject.<init>(JSONObject.java:182) at cn.richinfo.dm.business.a.a(:-1) at cn.richinfo.dm.service.f.run(:-1) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "pool-3-thread-8" prio=5 tid=26 Waiting | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c418c0 self=0xb400006f6bdcf000 | sysTid=27283 nice=0 cgrp=default sched=0/0 handle=0x6f14f64cc0 | state=S schedstat=( 207027702908 1982910208 20993 ) utm=17948 stm=2753 core=1 HZ=100 | stack=0x6f14e61000-0x6f14e63000 stackSize=1043KB | held mutexes= at sun.misc.Unsafe.park(Native method) - waiting on an unknown object at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "queued-work-looper" prio=5 tid=27 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c41988 self=0xb400006f6bbf2400 | sysTid=27363 nice=-2 cgrp=default sched=0/0 handle=0x6f13e5acc0 | state=S schedstat=( 401559066 2764794 165 ) utm=31 stm=8 core=6 HZ=100 | stack=0x6f13d57000-0x6f13d59000 stackSize=1043KB | held mutexes= native: #00 pc 00000000000d7a58 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8) native: #01 pc 0000000000019acc /system/lib64/libutils.so (android::Looper::pollInner(int)+184) native: #02 pc 00000000000199ac /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+112) native: #03 pc 0000000000118288 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) at android.os.MessageQueue.nativePollOnce(Native method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:193) at android.os.HandlerThread.run(HandlerThread.java:67) "pool-3-thread-9" prio=5 tid=28 Waiting | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c41a70 self=0xb400006f6bbf4000 | sysTid=15971 nice=0 cgrp=default sched=0/0 handle=0x6f8289ecc0 | state=S schedstat=( 254896 20625 1 ) utm=0 stm=0 core=1 HZ=100 | stack=0x6f8279b000-0x6f8279d000 stackSize=1043KB | held mutexes= at sun.misc.Unsafe.park(Native method) - waiting on an unknown object at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "Binder:27068_5" prio=5 tid=23 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c41b38 self=0xb400006f6bdc9c00 | sysTid=15972 nice=0 cgrp=default sched=0/0 handle=0x6f8276bcc0 | state=S schedstat=( 8655105 16940732 42 ) utm=0 stm=0 core=1 HZ=100 | stack=0x6f82674000-0x6f82676000 stackSize=995KB | held mutexes= native: #00 pc 00000000000d6a94 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4) native: #01 pc 00000000000935c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156) native: #02 pc 0000000000051a7c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+296) native: #03 pc 0000000000051c6c /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24) native: #04 pc 0000000000052528 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60) native: #05 pc 0000000000078630 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24) native: #06 pc 00000000000154cc /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) native: #07 pc 00000000000a5694 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) native: #08 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) native: #09 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #10 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Thread-1963" prio=5 tid=30 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12c41bb0 self=0xb400006f6bd49c00 | sysTid=16014 nice=0 cgrp=default sched=0/0 handle=0x6f8254bcc0 | state=S schedstat=( 2833698743 19182968 143 ) utm=277 stm=5 core=1 HZ=100 | stack=0x6f82448000-0x6f8244a000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 0000000000294d0c /apex/com.android.art/lib64/libart.so (art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool)+872) native: #04 pc 000000000029a914 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+4844) native: #05 pc 000000000065a860 /apex/com.android.art/lib64/libart.so (artAllocArrayFromCodeResolvedRegionTLAB+560) native: #06 pc 000000000013c084 /apex/com.android.art/lib64/libart.so (art_quick_alloc_array_resolved16_region_tlab+132) at java.util.Arrays.copyOf(Arrays.java:3257) at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448) at java.lang.StringBuilder.append(StringBuilder.java:137) at cn.richinfo.dm.receiver.DMBroadCastReceiver.b(:-1) at cn.richinfo.dm.receiver.DMBroadCastReceiver.a(:-1) at cn.richinfo.dm.receiver.a.run(:-1) at java.lang.Thread.run(Thread.java:923) "Binder:27068_6" prio=5 tid=29 Native | group="main" sCount=1 dsCount=0 flags=1 obj=0x12e00120 self=0xb400006f6bd48000 | sysTid=16265 nice=0 cgrp=default sched=0/0 handle=0x6f82662cc0 | state=S schedstat=( 1432711 3536458 6 ) utm=0 stm=0 core=0 HZ=100 | stack=0x6f8256b000-0x6f8256d000 stackSize=995KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 00000000003c5fcc /apex/com.android.art/lib64/libart.so (art::JNI<false>::CallStaticObjectMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+500) native: #03 pc 00000000000f44d8 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticObjectMethod(_jclass*, _jmethodID*, ...)+124) native: #04 pc 00000000001280d8 /system/lib64/libandroid_runtime.so (android::javaObjectForIBinder(_JNIEnv*, android::sp<android::IBinder> const&)+348) native: #05 pc 000000000012ba28 /system/lib64/libandroid_runtime.so (JavaDeathRecipient::binderDied(android::wp<android::IBinder> const&)+140) native: #06 pc 000000000004b800 /system/lib64/libbinder.so (android::BpBinder::reportOneDeath(android::BpBinder::Obituary const&)+148) native: #07 pc 000000000004b720 /system/lib64/libbinder.so (android::BpBinder::sendObituary()+148) native: #08 pc 0000000000052048 /system/lib64/libbinder.so (android::IPCThreadState::executeCommand(int)+680) native: #09 pc 0000000000051cf0 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+156) native: #10 pc 0000000000052528 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60) native: #11 pc 0000000000078630 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24) native: #12 pc 00000000000154cc /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260) native: #13 pc 00000000000a5694 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144) native: #14 pc 0000000000014d90 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412) native: #15 pc 00000000000eb868 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64) native: #16 pc 000000000008ba88 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (no managed stack frames) "Binder:27068_7" prio=5 tid=32 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12e00198 self=0xb400006f7866bc00 | sysTid=16267 nice=0 cgrp=default sched=0/0 handle=0x6f8232ecc0 | state=S schedstat=( 1138386 6174220 8 ) utm=0 stm=0 core=1 HZ=100 | stack=0x6f82237000-0x6f82239000 stackSize=995KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 000000000065a37c /apex/com.android.art/lib64/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+396) native: #06 pc 000000000013bb78 /apex/com.android.art/lib64/libart.so (art_quick_alloc_object_initialized_region_tlab+104) at android.content.pm.ParceledListSlice$1.createFromParcel(ParceledListSlice.java:80) at android.content.pm.ParceledListSlice$1.createFromParcel(ParceledListSlice.java:78) at android.app.IApplicationThread$Stub.onTransact(IApplicationThread.java:661) at android.os.Binder.execTransactInternal(Binder.java:1162) at android.os.Binder.execTransact(Binder.java:1126) "Thread-1966" prio=5 tid=31 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12e00210 self=0xb400006f6bd4b800 | sysTid=16269 nice=0 cgrp=default sched=0/0 handle=0x6f82225cc0 | state=S schedstat=( 697344 2097656 6 ) utm=0 stm=0 core=1 HZ=100 | stack=0x6f82122000-0x6f82124000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 000000000065a37c /apex/com.android.art/lib64/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+396) native: #06 pc 000000000013bb78 /apex/com.android.art/lib64/libart.so (art_quick_alloc_object_initialized_region_tlab+104) at android.content.ComponentName$1.createFromParcel(ComponentName.java:390) at android.content.ComponentName$1.createFromParcel(ComponentName.java:388) at android.app.IActivityManager$Stub$Proxy.startService(IActivityManager.java:6064) at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1710) at android.app.ContextImpl.startService(ContextImpl.java:1680) at android.content.ContextWrapper.startService(ContextWrapper.java:731) at android.content.ContextWrapper.startService(ContextWrapper.java:731) at cn.richinfo.dm.receiver.DMBroadCastReceiver.b(:-1) at cn.richinfo.dm.receiver.DMBroadCastReceiver.a(:-1) at cn.richinfo.dm.receiver.a.run(:-1) at java.lang.Thread.run(Thread.java:923) "Thread-1965" prio=5 tid=33 WaitingForGcToComplete | group="main" sCount=1 dsCount=0 flags=1 obj=0x12e003a8 self=0xb400006f6bd4d400 | sysTid=16268 nice=0 cgrp=default sched=0/0 handle=0x6f82438cc0 | state=S schedstat=( 898177 6904949 5 ) utm=0 stm=0 core=5 HZ=100 | stack=0x6f82335000-0x6f82337000 stackSize=1043KB | held mutexes= native: #00 pc 0000000000086b4c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28) native: #01 pc 00000000001b0418 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148) native: #02 pc 000000000028f01c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)+144) native: #03 pc 00000000002a725c /apex/com.android.art/lib64/libart.so (art::gc::Heap::WaitForGcToComplete(art::gc::GcCause, art::Thread*)+440) native: #04 pc 00000000002996c8 /apex/com.android.art/lib64/libart.so (art::gc::Heap::AllocateInternalWithGc(art::Thread*, art::gc::AllocatorType, bool, unsigned long, unsigned long*, unsigned long*, unsigned long*, art::ObjPtr<art::mirror::Class>*)+160) native: #05 pc 000000000065a37c /apex/com.android.art/lib64/libart.so (artAllocObjectFromCodeInitializedRegionTLAB+396) native: #06 pc 000000000013bb78 /apex/com.android.art/lib64/libart.so (art_quick_alloc_object_initialized_region_tlab+104) at android.content.ComponentName$1.createFromParcel(ComponentName.java:390) at android.content.ComponentName$1.createFromParcel(ComponentName.java:388) at android.app.IActivityManager$Stub$Proxy.startService(IActivityManager.java:6064) at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1710) at android.app.ContextImpl.startService(ContextImpl.java:1680) at android.content.ContextWrapper.startService(ContextWrapper.java:731) at android.content.ContextWrapper.startService(ContextWrapper.java:731) at cn.richinfo.dm.receiver.DMBroadCastReceiver.b(:-1) at cn.richinfo.dm.receiver.DMBroadCastReceiver.a(:-1) at cn.richinfo.dm.receiver.a.run(:-1) at java.lang.Thread.run(Thread.java:923) ----- end 27068 ----- ----- Waiting Channels: pid 27068 at 2025-09-01 08:35:45 ----- Cmd line: com.miui.dmregservice sysTid=27068 do_epoll_wait sysTid=27074 futex_wait_queue_me sysTid=27075 futex_wait_queue_me sysTid=27076 futex_wait_queue_me sysTid=27077 futex_wait_queue_me sysTid=27078 do_sigtimedwait sysTid=27079 futex_wait_queue_me sysTid=27080 futex_wait_queue_me sysTid=27081 futex_wait_queue_me sysTid=27082 0 sysTid=27083 futex_wait_queue_me sysTid=27084 futex_wait_queue_me sysTid=27085 binder_ioctl sysTid=27086 binder_ioctl sysTid=27088 binder_ioctl sysTid=27089 do_epoll_wait sysTid=27090 futex_wait_queue_me sysTid=27091 futex_wait_queue_me sysTid=27114 futex_wait_queue_me sysTid=27116 futex_wait_queue_me sysTid=27117 futex_wait_queue_me sysTid=27118 futex_wait_queue_me sysTid=27226 futex_wait_queue_me sysTid=27250 futex_wait_queue_me sysTid=27283 futex_wait_queue_me sysTid=27363 do_epoll_wait sysTid=15971 futex_wait_queue_me sysTid=15972 binder_ioctl sysTid=16013 futex_wait_queue_me sysTid=16014 futex_wait_queue_me ----- end 27068 -----
09-06
帮我修改下面代码,把训练模型的方法从抽样改成所有数据进行训练 # -*- coding: utf-8 -*- """ Created on Sat Aug 9 11:56:46 2025 @author: srx20 """ # -*- coding: utf-8 -*- """ Created on Sat Aug 9 10:33:06 2025 @author: srx20 """ import os import glob import pandas as pd import numpy as np import joblib import gc from datetime import datetime, timedelta from sklearn.preprocessing import StandardScaler from sklearn.cluster import MiniBatchKMeans from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import classification_report, confusion_matrix import talib as ta import warnings import chardet import psutil import sys import pyarrow as pa import pyarrow.parquet as pq import pyarrow.csv as pc from tqdm import tqdm from sklearn.model_selection import train_test_split # 修复警告处理 warnings.filterwarnings("ignore", category=np.VisibleDeprecationWarning) warnings.filterwarnings("ignore", category=RuntimeWarning) warnings.filterwarnings("ignore", category=pd.errors.ParserWarning) warnings.filterwarnings("ignore", category=UserWarning) warnings.filterwarnings("ignore", category=FutureWarning) # 忽略FutureWarning class StockPredictionSystem: def __init__(self, config): """ 初始化预测系统 - 针对超大内存优化 :param config: 配置字典 """ self.config = config self.five_min_paths = { 'sz': config['five_min_sz_path'], 'sh': config['five_min_sh_path'] } self.daily_paths = { 'sz': config['daily_sz_path'], 'sh': config['daily_sh_path'] } self.output_path = config['output_path'] self.start_date = datetime.strptime(config['start_date'], '%Y-%m-%d') self.end_date = datetime.strptime(config['end_date'], '%Y-%m-%d') self.data = None self.features = None self.labels = None self.scaler = StandardScaler() self.cluster_model = None self.prediction_model = None self.feature_cols = [] self.temp_dir = os.path.join(self.output_path, "temp") os.makedirs(self.temp_dir, exist_ok=True) self.parquet_files = [] def print_memory_usage(self, step_name): """打印当前内存使用情况""" process = psutil.Process(os.getpid()) mem = process.memory_info().rss / 1024 ** 2 print(f"[{step_name}] 当前内存使用: {mem:.2f} MB") def safe_read_csv(self, file_path, required_columns): """ 安全读取CSV文件 - 使用PyArrow进行高效读取 :param file_path: 文件路径 :param required_columns: 需要的列名列表 :return: 读取的DataFrame或None """ try: # 检查文件大小 if not os.path.exists(file_path): print(f"文件不存在: {file_path}") return None file_size = os.path.getsize(file_path) if file_size == 0: print(f"文件 {file_path} 大小为0,跳过") return None # 使用PyArrow读取CSV read_options = pc.ReadOptions( use_threads=True, block_size=4096 * 1024 # 4MB块大小 ) parse_options = pc.ParseOptions(delimiter=',') convert_options = pc.ConvertOptions( include_columns=required_columns, column_types={ 'date': pa.string(), 'time': pa.string(), 'open': pa.float32(), 'high': pa.float32(), 'low': pa.float32(), 'close': pa.float32(), 'volume': pa.float32(), 'amount': pa.float32() } ) table = pc.read_csv( file_path, read_options=read_options, parse_options=parse_options, convert_options=convert_options ) # 转换为Pandas DataFrame df = table.to_pandas() # 检查是否读取到数据 if df.empty: print(f"文件 {file_path} 读取后为空") return None return df except Exception as e: print(f"读取文件 {file_path} 时出错: {str(e)}") return None def process_and_save_chunk(self, df, market, stock_code, chunk_index): """ 处理单个股票的数据块并保存为Parquet文件 - 内存优化版本 """ if df is None or df.empty: return None try: # 添加市场前缀 df['stock_code'] = f"{market}_{stock_code}" # 修复日期时间转换问题 df['date'] = df['date'].astype(str).str.zfill(8) # 填充为8位字符串 df['time'] = df['time'].astype(str) # 处理时间格式 df['time'] = df['time'].apply( lambda x: f"{x[:2]}:{x[2:4]}" if len(x) == 4 else x ) # 合并日期和时间 df['datetime'] = pd.to_datetime( df['date'] + ' ' + df['time'], format='%Y%m%d %H:%M', errors='coerce' ) # 删除无效的日期时间 df = df.dropna(subset=['datetime']) # 筛选日期范围 df = df[(df['datetime'] >= self.start_date) & (df['datetime'] <= self.end_date)] if df.empty: return None # 优化内存使用 df = df[['stock_code', 'datetime', 'open', 'high', 'low', 'close', 'volume', 'amount']] # 保存为Parquet文件 output_file = os.path.join(self.temp_dir, f"{market}_{stock_code}_{chunk_index}.parquet") # 使用PyArrow直接写入Parquet,避免Pandas中间转换 table = pa.Table.from_pandas(df, preserve_index=False) pq.write_table(table, output_file, compression='SNAPPY') return output_file except Exception as e: print(f"处理股票 {stock_code} 时出错: {str(e)}") return None def incremental_merge_parquet_files(self, parquet_files, batch_size=100): """ 增量合并Parquet文件 - 避免一次性加载所有数据 :param parquet_files: Parquet文件列表 :param batch_size: 每次合并的文件数量 :return: 合并后的Parquet文件路径 """ merged_file = os.path.join(self.temp_dir, "merged_data.parquet") # 如果文件已存在,删除 if os.path.exists(merged_file): os.remove(merged_file) # 分批合并文件 for i in tqdm(range(0, len(parquet_files), batch_size), desc="合并Parquet文件"): batch_files = parquet_files[i:i+batch_size] # 读取当前批次文件 tables = [] for file in batch_files: try: table = pq.read_table(file) tables.append(table) except Exception as e: print(f"读取文件 {file} 出错: {str(e)}") if not tables: continue # 合并当前批次 merged_table = pa.concat_tables(tables) # 追加到输出文件 if os.path.exists(merged_file): # 追加模式 with pq.ParquetWriter(merged_file, merged_table.schema) as writer: writer.write_table(merged_table) else: # 首次写入 pq.write_table(merged_table, merged_file) # 释放内存 del tables del merged_table gc.collect() return merged_file def load_and_preprocess_data(self): """ 加载和预处理数据 - 使用增量合并避免内存溢出 """ print("开始加载和预处理数据...") self.print_memory_usage("开始加载数据") # 创建临时目录 os.makedirs(self.temp_dir, exist_ok=True) parquet_files = [] # 加载五分钟线数据 for market, path in self.five_min_paths.items(): print(f"开始处理市场: {market}, 路径: {path}") file_count = 0 processed_count = 0 # 获取文件列表 csv_files = list(glob.glob(os.path.join(path, '*.csv'))) print(f"找到 {len(csv_files)} 个文件") for file_path in tqdm(csv_files, desc=f"处理 {market} 市场文件"): file_count += 1 stock_code = os.path.basename(file_path).split('.')[0] try: # 安全读取CSV文件 df = self.safe_read_csv(file_path, ['date', 'time', 'open', 'high', 'low', 'close', 'volume', 'amount']) if df is None: continue # 处理并保存为Parquet output_file = self.process_and_save_chunk(df, market, stock_code, processed_count) if output_file: parquet_files.append(output_file) processed_count += 1 # 每处理100个文件释放内存 if processed_count % 100 == 0: self.print_memory_usage(f"已处理 {processed_count} 个文件") gc.collect() except Exception as e: print(f"处理文件 {file_path} 时出错: {str(e)}") continue print(f"市场 {market} 完成: 共 {file_count} 个文件, 成功处理 {processed_count} 个文件") # 如果没有找到有效文件 if not parquet_files: raise ValueError("没有找到有效的五分钟线数据") print(f"开始增量合并 {len(parquet_files)} 个Parquet文件...") self.print_memory_usage("合并前") # 增量合并Parquet文件 merged_file = self.incremental_merge_parquet_files(parquet_files, batch_size=50) # 加载合并后的数据 print(f"加载合并后的数据: {merged_file}") self.data = pq.read_table(merged_file).to_pandas() # 优化内存使用 self.data['stock_code'] = self.data['stock_code'].astype('category') print(f"数据合并完成,共 {len(self.data)} 条记录") self.print_memory_usage("合并后") # 清理临时文件 for file in parquet_files: try: os.remove(file) except: pass # 加载日线数据 daily_data = [] daily_required_columns = ['date', 'open', 'high', 'low', 'close', 'volume'] for market, path in self.daily_paths.items(): print(f"开始处理日线市场: {market}, 路径: {path}") file_count = 0 processed_count = 0 # 获取所有CSV文件 all_files = list(glob.glob(os.path.join(path, '*.csv'))) print(f"找到 {len(all_files)} 个日线文件") for file_path in tqdm(all_files, desc=f"处理 {market} 日线文件"): file_count += 1 stock_code = os.path.basename(file_path).split('.')[0] try: # 安全读取CSV文件 df = self.safe_read_csv(file_path, daily_required_columns) if df is None or df.empty: continue # 添加市场前缀 df['stock_code'] = f"{market}_{stock_code}" # 转换日期格式 df['date'] = pd.to_datetime(df['date'], errors='coerce') # 删除无效日期 df = df.dropna(subset=['date']) # 筛选日期范围 df = df[(df['date'] >= self.start_date) & (df['date'] <= self.end_date)] if df.empty: continue # 优化内存使用 df = df[['stock_code', 'date', 'open', 'high', 'low', 'close', 'volume']] # 优化数据类型 - 修复错误: 使用astype而不是ast df['open'] = df['open'].astype(np.float32) df['high'] = df['high'].astype(np.float32) df['low'] = df['low'].astype(np.float32) df['close'] = df['close'].astype(np.float32) df['volume'] = df['volume'].astype(np.float32) daily_data.append(df) processed_count += 1 if processed_count % 100 == 0: self.print_memory_usage(f"已处理 {processed_count} 个日线文件") gc.collect() except Exception as e: print(f"处理日线文件 {file_path} 时出错: {str(e)}") continue print(f"日线市场 {market} 完成: 共 {file_count} 个文件, 成功处理 {processed_count} 个文件") # 合并日线数据 if daily_data: daily_df = pd.concat(daily_data, ignore_index=True) daily_df['stock_code'] = daily_df['stock_code'].astype('category') # 添加日线特征 self._add_daily_features(daily_df) else: print("警告: 没有找到日线数据") print(f"数据加载完成,共 {len(self.data)} 条记录") self.print_memory_usage("数据加载完成") def _add_daily_features(self, daily_df): """ 添加日线特征到五分钟线数据 - 使用内存优化技术 """ print("添加日线特征...") # 预处理日线数据 daily_df = daily_df.sort_values(['stock_code', 'date']) # 计算日线技术指标 - 修复FutureWarning daily_df['daily_ma5'] = daily_df.groupby('stock_code', observed=True)['close'].transform( lambda x: x.rolling(5).mean()) daily_df['daily_ma10'] = daily_df.groupby('stock_code', observed=True)['close'].transform( lambda x: x.rolling(10).mean()) daily_df['daily_vol_ma5'] = daily_df.groupby('stock_code', observed=True)['volume'].transform( lambda x: x.rolling(5).mean()) # 计算MACD - 使用更高效的方法 def calculate_macd(group): group = group.sort_values('date') if len(group) < 26: return group.assign(daily_macd=np.nan, daily_signal=np.nan) close_vals = group['close'].values.astype(np.float64) macd, signal, _ = ta.MACD(close_vals, fastperiod=12, slowperiod=26, signalperiod=9) return group.assign(daily_macd=macd, daily_signal=signal) daily_df = daily_df.groupby('stock_code', group_keys=False, observed=True).apply(calculate_macd) # 提取日期部分用于合并 self.data['date'] = self.data['datetime'].dt.date.astype('datetime64[ns]') # 优化数据类型 daily_df = daily_df[['stock_code', 'date', 'daily_ma5', 'daily_ma10', 'daily_vol_ma5', 'daily_macd', 'daily_signal']] daily_df['daily_ma5'] = daily_df['daily_ma5'].astype(np.float32) daily_df['daily_ma10'] = daily_df['daily_ma10'].astype(np.float32) daily_df['daily_vol_ma5'] = daily_df['daily_vol_ma5'].astype(np.float32) daily_df['daily_macd'] = daily_df['daily_macd'].astype(np.float32) daily_df['daily_signal'] = daily_df['daily_signal'].astype(np.float32) # 合并日线特征 self.data = pd.merge( self.data, daily_df, on=['stock_code', 'date'], how='left' ) # 删除临时列 del self.data['date'] # 释放内存 del daily_df gc.collect() def create_features(self): """ 创建特征工程 - 使用内存优化技术 """ print("开始创建特征...") self.print_memory_usage("创建特征前") if self.data is None: raise ValueError("请先加载数据") # 按股票和时间排序 self.data = self.data.sort_values(['stock_code', 'datetime']) # 特征列表 features = [] # 1. 基础特征 features.append('open') features.append('high') features.append('low') features.append('close') features.append('volume') features.append('amount') # 2. 技术指标 - 使用分组计算避免内存溢出 # 计算移动平均线 self.data['ma5'] = self.data.groupby('stock_code', observed=True)['close'].transform( lambda x: x.rolling(5, min_periods=1).mean()) self.data['ma10'] = self.data.groupby('stock_code', observed=True)['close'].transform( lambda x: x.rolling(10, min_periods=1).mean()) features.extend(['ma5', 'ma10']) # 计算RSI - 使用更高效的方法 print("计算RSI指标...") def calculate_rsi(group): group = group.sort_values('datetime') close = group['close'].values.astype(np.float64) rsi = ta.RSI(close, timeperiod=14) return group.assign(rsi=rsi) self.data = self.data.groupby('stock_code', group_keys=False, observed=True).apply(calculate_rsi) features.append('rsi') # 3. 波动率特征 print("计算波动率特征...") self.data['price_change'] = self.data.groupby('stock_code', observed=True)['close'].pct_change() self.data['volatility'] = self.data.groupby('stock_code', observed=True)['price_change'].transform( lambda x: x.rolling(10, min_periods=1).std()) features.append('volatility') # 4. 成交量特征 self.data['vol_change'] = self.data.groupby('stock_code', observed=True)['volume'].pct_change() self.data['vol_ma5'] = self.data.groupby('stock_code', observed=True)['volume'].transform( lambda x: x.rolling(5, min_periods=1).mean()) features.extend(['vol_change', 'vol_ma5']) # 5. 日线特征 features.extend(['daily_ma5', 'daily_ma10', 'daily_vol_ma5', 'daily_macd', 'daily_signal']) # 保存特征列 self.feature_cols = features # 处理缺失值 - 只删除特征列中的缺失值 self.data = self.data.dropna(subset=features) # 优化数据类型 - 使用astype而不是ast for col in features: if self.data[col].dtype == np.float64: self.data[col] = self.data[col].astype(np.float32) print(f"特征创建完成,共 {len(features)} 个特征") self.print_memory_usage("创建特征后") def clean_data(self): """ 清洗数据 - 处理无穷大和超出范围的值(修复索引问题) """ print("开始数据清洗...") self.print_memory_usage("清洗前") # 1. 检查无穷大值 inf_mask = np.isinf(self.data[self.feature_cols].values) inf_rows = np.any(inf_mask, axis=1) inf_count = np.sum(inf_rows) if inf_count > 0: print(f"发现 {inf_count} 行包含无穷大值,正在清理...") # 将无穷大替换为NaN self.data[self.feature_cols] = self.data[self.feature_cols].replace([np.inf, -np.inf], np.nan) # 2. 检查超出float32范围的值 float32_max = np.finfo(np.float32).max float32_min = np.finfo(np.float32).min # 统计超出范围的值 overflow_count = 0 for col in self.feature_cols: col_max = self.data[col].max() col_min = self.data[col].min() if col_max > float32_max or col_min < float32_min: overflow_count += 1 print(f"列 {col} 包含超出float32范围的值: min={col_min}, max={col_max}") if overflow_count > 0: print(f"共发现 {overflow_count} 列包含超出float32范围的值,正在处理...") # 缩放到安全范围 for col in self.feature_cols: col_min = self.data[col].min() col_max = self.data[col].max() # 如果范围过大,进行缩放 if col_max - col_min > 1e6: print(f"列 {col} 范围过大 ({col_min} 到 {col_max}),进行缩放...") self.data[col] = (self.data[col] - col_min) / (col_max - col_min) # 3. 处理NaN值 - 修复索引问题 nan_count = self.data[self.feature_cols].isna().sum().sum() if nan_count > 0: print(f"发现 {nan_count} 个NaN值,使用前向填充处理...") # 方法1: 使用transform保持索引一致 for col in self.feature_cols: self.data[col] = self.data.groupby('stock_code', observed=True)[col].transform( lambda x: x.fillna(method='ffill').fillna(method='bfill').fillna(0) ) # 方法2: 使用循环逐组处理(备用方法) # for stock in self.data['stock_code'].unique(): # stock_mask = self.data['stock_code'] == stock # self.data.loc[stock_mask, self.feature_cols] = self.data.loc[stock_mask, self.feature_cols].fillna(method='ffill').fillna(method='bfill').fillna(0) # 4. 最终检查 cleaned = True for col in self.feature_cols: if np.isinf(self.data[col]).any() or self.data[col].isna().any(): print(f"警告: 列 {col} 仍包含无效值") cleaned = False if cleaned: print("数据清洗完成") else: print("数据清洗完成,但仍存在部分问题") self.print_memory_usage("清洗后") def create_labels(self): """ 创建标签 - 添加新条件: 1. 次日(T+1)收盘价(15:00)比次日(T+1)9:35收盘价大5% 2. 后日(T+2)9:35收盘价比次日(T+1)收盘价(15:00)大1% """ print("开始创建标签...") self.print_memory_usage("创建标签前") if self.data is None: raise ValueError("请先加载数据") # 按股票和时间排序 self.data = self.data.sort_values(['stock_code', 'datetime']) # 添加日期列用于合并 self.data['date'] = self.data['datetime'].dt.date # 创建每日关键时间点价格数据 daily_key_points = self.data.groupby(['stock_code', 'date']).apply( lambda x: pd.Series({ 'time9_35_close': x[x['datetime'].dt.time == pd.to_datetime('09:35:00').time()]['close'].iloc[0] if not x[x['datetime'].dt.time == pd.to_datetime('09:35:00').time()].empty else np.nan, 'time15_00_close': x[x['datetime'].dt.time == pd.to_datetime('15:00:00').time()]['close'].iloc[0] if not x[x['datetime'].dt.time == pd.to_datetime('15:00:00').time()].empty else np.nan }) ).reset_index() # 为每日关键点添加次日(T+1)和后日(T+2)数据 daily_key_points = daily_key_points.sort_values(['stock_code', 'date']) daily_key_points['next_date'] = daily_key_points.groupby('stock_code')['date'].shift(-1) daily_key_points['next_next_date'] = daily_key_points.groupby('stock_code')['date'].shift(-2) # 合并次日(T+1)数据 daily_key_points = pd.merge( daily_key_points, daily_key_points[['stock_code', 'date', 'time9_35_close', 'time15_00_close']].rename( columns={ 'date': 'next_date', 'time9_35_close': 'next_time9_35_close', 'time15_00_close': 'next_time15_00_close' } ), on=['stock_code', 'next_date'], how='left' ) # 合并后日(T+2)数据 daily_key_points = pd.merge( daily_key_points, daily_key_points[['stock_code', 'date', 'time9_35_close']].rename( columns={ 'date': 'next_next_date', 'time9_35_close': 'next_next_time9_35_close' } ), on=['stock_code', 'next_next_date'], how='left' ) # 将关键点数据合并回原始数据 self.data = pd.merge( self.data, daily_key_points[['stock_code', 'date', 'next_time9_35_close', 'next_time15_00_close', 'next_next_time9_35_close']], on=['stock_code', 'date'], how='left' ) # 计算新条件 cond1 = (self.data['next_time15_00_close'] > self.data['next_time9_35_close'] * 1.05) cond2 = (self.data['next_next_time9_35_close'] > self.data['next_time15_00_close'] * 1.01) # 创建标签(满足两个条件则为1) self.data['label'] = np.where(cond1 & cond2, 1, 0).astype(np.int8) # 删除中间列 self.data.drop([ 'date', 'next_time9_35_close', 'next_time15_00_close', 'next_next_time9_35_close' ], axis=1, inplace=True, errors='ignore') # 保存标签 self.labels = self.data['label'] # 分析标签分布 label_counts = self.data['label'].value_counts(normalize=True) print(f"标签分布:\n{label_counts}") print("标签创建完成") self.print_memory_usage("创建标签后") def perform_clustering(self, n_clusters=5, batch_size=100000): """ 执行聚类分析 - 使用MiniBatchKMeans处理大数据 :param n_clusters: 聚类数量 :param batch_size: 每次处理的样本数量 """ print(f"开始聚类分析,聚类数: {n_clusters}...") self.print_memory_usage("聚类前") if self.feature_cols is None: raise ValueError("请先创建特征") # 添加数据清洗步骤 self.clean_data() # 标准化特征 print("标准化特征...") self.scaler.fit(self.data[self.feature_cols]) # 使用MiniBatchKMeans进行聚类 self.cluster_model = MiniBatchKMeans( n_clusters=n_clusters, batch_size=batch_size, random_state=42, n_init=3 ) # 分批处理数据 print("分批聚类...") n_samples = len(self.data) for i in tqdm(range(0, n_samples, batch_size), desc="聚类进度"): batch_data = self.data.iloc[i:i+batch_size] scaled_batch = self.scaler.transform(batch_data[self.feature_cols]) self.cluster_model.partial_fit(scaled_batch) # 获取最终聚类结果 print("获取聚类结果...") clusters = [] for i in tqdm(range(0, n_samples, batch_size), desc="分配聚类"): batch_data = self.data.iloc[i:i+batch_size] scaled_batch = self.scaler.transform(batch_data[self.feature_cols]) batch_clusters = self.cluster_model.predict(scaled_batch) clusters.append(batch_clusters) # 添加聚类结果到数据 self.data['cluster'] = np.concatenate(clusters) self.feature_cols.append('cluster') # 分析聚类结果 cluster_summary = self.data.groupby('cluster')['label'].agg(['mean', 'count']) print("聚类结果分析:") print(cluster_summary) # 保存聚类模型 cluster_model_path = os.path.join( self.output_path, "分钟线预测训练聚类模型.pkl" ) joblib.dump(self.cluster_model, cluster_model_path) print(f"聚类模型已保存至: {cluster_model_path}") self.print_memory_usage("聚类后") def train_prediction_model(self, sample_fraction=0.1): """ 训练预测模型 - 使用数据抽样减少内存使用 :param sample_fraction: 抽样比例 """ print("开始训练预测模型...") self.print_memory_usage("训练模型前") if self.feature_cols is None or self.labels is None: raise ValueError("请先创建特征和标签") # 抽样数据 if sample_fraction < 1.0: print(f"抽样 {sample_fraction*100:.1f}% 数据用于训练") sample_data = self.data.sample(frac=sample_fraction, random_state=42) X = sample_data[self.feature_cols] y = sample_data['label'] else: X = self.data[self.feature_cols] y = self.labels # 检查类别分布 if y.nunique() < 2: print("警告: 只有一个类别的数据,无法训练模型") return # 划分训练集和测试集 X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42, stratify=y ) # 训练随机森林分类器 self.prediction_model = RandomForestClassifier( n_estimators=100, # 减少树的数量 max_depth=8, # 减小最大深度 min_samples_split=10, class_weight='balanced', random_state=42, n_jobs=-1 ) self.prediction_model.fit(X_train, y_train) # 评估模型 y_pred = self.prediction_model.predict(X_test) print("模型评估报告:") print(classification_report(y_test, y_pred)) # 打印混淆矩阵 cm = confusion_matrix(y_test, y_pred) print("混淆矩阵:") print(cm) # 保存预测模型 model_path = os.path.join( self.output_path, "分钟线预测训练模型.pkl" ) joblib.dump(self.prediction_model, model_path) print(f"预测模型已保存至: {model_path}") self.print_memory_usage("训练模型后") def predict_and_save(self, output_results=True): """ 使用模型进行预测并保存结果 :param output_results: 是否输出预测结果 """ print("开始预测...") self.print_memory_usage("预测前") if self.prediction_model is None: raise ValueError("请先训练预测模型") # 准备预测数据 X = self.data[self.feature_cols] # 分批预测 predictions = [] batch_size = 10000 n_samples = len(X) for i in tqdm(range(0, n_samples, batch_size), desc="预测进度"): batch_data = X.iloc[i:i+batch_size] batch_pred = self.prediction_model.predict(batch_data) predictions.append(batch_pred) # 合并预测结果 self.data['prediction'] = np.concatenate(predictions) # 保存预测结果 if output_results: output_file = os.path.join(self.output_path, "预测结果.csv") self.data[['stock_code', 'datetime', 'close', 'label', 'prediction']].to_csv(output_file, index=False) print(f"预测结果已保存至: {output_file}") # 分析预测效果 accuracy = (self.data['label'] == self.data['prediction']).mean() print(f"整体预测准确率: {accuracy:.4f}") # 按股票分析预测效果 stock_accuracy = self.data.groupby('stock_code').apply( lambda x: (x['label'] == x['prediction']).mean() ) print("\n股票预测准确率统计:") print(stock_accuracy.describe()) self.print_memory_usage("预测后") def run(self, output_results=True, sample_fraction=0.1): """ 运行整个流程 - 使用内存优化技术 """ try: # 分步执行,每步完成后释放内存 self.load_and_preprocess_data() gc.collect() self.print_memory_usage("数据加载后") self.create_features() gc.collect() self.print_memory_usage("特征创建后") self.create_labels() # 使用新的标签创建方法 gc.collect() self.print_memory_usage("标签创建后") self.perform_clustering(n_clusters=self.config.get('n_clusters', 5)) gc.collect() self.print_memory_usage("聚类后") self.train_prediction_model(sample_fraction=sample_fraction) gc.collect() self.print_memory_usage("模型训练后") self.predict_and_save(output_results) gc.collect() self.print_memory_usage("预测后") print("训练和预测流程完成!") except KeyboardInterrupt: print("用户中断执行") except Exception as e: print(f"运行过程中出错: {str(e)}") import traceback traceback.print_exc() # 配置参数 config = { # 数据路径配置 'five_min_sz_path': r"D:\股票量化数据库\股票五分钟线csv数据\深证", 'five_min_sh_path': r"D:\股票量化数据库\股票五分钟线csv数据\上证", 'daily_sz_path': r"D:\股票量化数据库\股票csv数据\深证", 'daily_sh_path': r"D:\股票量化数据库\股票csv数据\上证", # 输出路径 'output_path': r"D:\股票量化数据库\预测结果", # 时间范围配置 'start_date': '2023-09-08', 'end_date': '2025-08-07', # 聚类配置 'n_clusters': 5 } # 创建并运行系统 if __name__ == "__main__": # 打印环境信息 print(f"Python版本: {sys.version}") print(f"Pandas版本: {pd.__version__}") # 是否输出预测结果 output_results = True # 抽样比例 (0.1 = 10%) sample_fraction = 0.1 # 设置Pandas内存选项 pd.set_option('mode.chained_assignment', None) pd.set_option('display.max_columns', None) # 设置内存优化选项 pd.set_option('compute.use_numexpr', True) pd.set_option('compute.use_bottleneck', True) # 创建并运行系统 system = StockPredictionSystem(config) system.run(output_results=output_results, sample_fraction=sample_fraction)
08-10
Traceback (most recent call last): File "D:\miniconda\envs\yolo1\lib\threading.py", line 932, in _bootstrap_inner self.run() File "D:\miniconda\envs\yolo1\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "D:\Users\a\Desktop\qq_3045834499\yolov8-42\ultralytics\utils\plotting.py", line 992, in plot_images 1/100 1.01G 2.671 4.054 1.413 243 640: 0%| | 1/1365 [00:11<4:19:25, 11.41s/it] mosaic = np.full((int(ns * h), int(ns * w), 3), 255, dtype=np.uint8) # init File "D:\miniconda\envs\yolo1\lib\site-packages\numpy\core\numeric.py", line 343, in full Traceback (most recent call last): File "D:\Users\a\Desktop\qq_3045834499\yolov8-42\42_demo\start_train.py", line 17, in <module> a = empty(shape, dtype, order) numpy.core._exceptions.MemoryError: Unable to allocate 4.69 MiB for an array with shape (1280, 1280, 3) and data type uint8 results = model.train(data='A_my_data.yaml', epochs=100, imgsz=640, device=[0,], workers=0, batch=4, cache=True, amp=False) # 开始训练 File "D:\Users\a\Desktop\qq_3045834499\yolov8-42\ultralytics\engine\model.py", line 811, in train self.trainer.train() File "D:\Users\a\Desktop\qq_3045834499\yolov8-42\ultralytics\engine\trainer.py", line 208, in train self._do_train(world_size) File "D:\Users\a\Desktop\qq_3045834499\yolov8-42\ultralytics\engine\trainer.py", line 367, in _do_train for i, batch in pbar: File "D:\miniconda\envs\yolo1\lib\site-packages\tqdm\std.py", line 1195, in __iter__ for obj in iterable: File "D:\Users\a\Desktop\qq_3045834499\yolov8-42\ultralytics\data\build.py", line 48, in __iter__ yield next(self.iterator) File "D:\miniconda\envs\yolo1\lib\site-packages\torch\utils\data\dataloader.py", line 517, in __next__ data = self._next_data() File "D:\miniconda\envs\yolo1\lib\site-packages\torch\utils\data\dataloader.py", line 557, in _next_data data = self._dataset_fetcher.fetch(index
04-04
/home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp: In function ‘int main(int, char**)’: /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:489:25: error: ‘make_unique’ is not a member of ‘std’ 489 | cmds.push_back(std::make_unique<AngleSequenceCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:489:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:489:57: error: expected primary-expression before ‘>’ token 489 | cmds.push_back(std::make_unique<AngleSequenceCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:491:25: error: ‘make_unique’ is not a member of ‘std’ 491 | cmds.push_back(std::make_unique<AngleSequenceCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:491:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:491:57: error: expected primary-expression before ‘>’ token 491 | cmds.push_back(std::make_unique<AngleSequenceCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:493:25: error: ‘make_unique’ is not a member of ‘std’ 493 | cmds.push_back(std::make_unique<AngleSequenceCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:493:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:493:57: error: expected primary-expression before ‘>’ token 493 | cmds.push_back(std::make_unique<AngleSequenceCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:495:25: error: ‘make_unique’ is not a member of ‘std’ 495 | cmds.push_back(std::make_unique<Angle3Command>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:495:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:495:50: error: expected primary-expression before ‘>’ token 495 | cmds.push_back(std::make_unique<Angle3Command>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:497:25: error: ‘make_unique’ is not a member of ‘std’ 497 | cmds.push_back(std::make_unique<Angle3Command>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:497:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:497:50: error: expected primary-expression before ‘>’ token 497 | cmds.push_back(std::make_unique<Angle3Command>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:499:25: error: ‘make_unique’ is not a member of ‘std’ 499 | cmds.push_back(std::make_unique<ReadCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:499:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:499:48: error: expected primary-expression before ‘>’ token 499 | cmds.push_back(std::make_unique<ReadCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:501:25: error: ‘make_unique’ is not a member of ‘std’ 501 | cmds.push_back(std::make_unique<ReadCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:501:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:501:48: error: expected primary-expression before ‘>’ token 501 | cmds.push_back(std::make_unique<ReadCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:503:25: error: ‘make_unique’ is not a member of ‘std’ 503 | cmds.push_back(std::make_unique<ReadCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:503:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:503:48: error: expected primary-expression before ‘>’ token 503 | cmds.push_back(std::make_unique<ReadCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:505:25: error: ‘make_unique’ is not a member of ‘std’ 505 | cmds.push_back(std::make_unique<ReadCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:505:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:505:48: error: expected primary-expression before ‘>’ token 505 | cmds.push_back(std::make_unique<ReadCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:507:25: error: ‘make_unique’ is not a member of ‘std’ 507 | cmds.push_back(std::make_unique<ReadCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:507:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:507:48: error: expected primary-expression before ‘>’ token 507 | cmds.push_back(std::make_unique<ReadCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:509:25: error: ‘make_unique’ is not a member of ‘std’ 509 | cmds.push_back(std::make_unique<SpeedSequenceCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:509:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:509:57: error: expected primary-expression before ‘>’ token 509 | cmds.push_back(std::make_unique<SpeedSequenceCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:511:25: error: ‘make_unique’ is not a member of ‘std’ 511 | cmds.push_back(std::make_unique<SpeedSequenceCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:511:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:511:57: error: expected primary-expression before ‘>’ token 511 | cmds.push_back(std::make_unique<SpeedSequenceCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:513:25: error: ‘make_unique’ is not a member of ‘std’ 513 | cmds.push_back(std::make_unique<SpeedSequenceCommand>( | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:513:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:513:57: error: expected primary-expression before ‘>’ token 513 | cmds.push_back(std::make_unique<SpeedSequenceCommand>( | ^ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:515:25: error: ‘make_unique’ is not a member of ‘std’ 515 | cmds.push_back(std::make_unique<InitCommand>(200.0)); | ^~~~~~~~~~~ /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:515:25: note: ‘std::make_unique’ is only available from C++14 onwards /home/aurora/rs485_static_ws/src/rs485_node/src/angle_publisher_node.cpp:515:48: error: expected primary-expression before ‘>’ token 515 | cmds.push_back(std::make_unique<InitCommand>(200.0)); | ^ make[2]: *** [rs485_node/CMakeFiles/angle_publisher_node.dir/build.make:63: rs485_node/CMakeFiles/angle_publisher_node.dir/src/angle_publisher_node.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:885: rs485_node/CMakeFiles/angle_publisher_node.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 95%] Linking CXX executable /home/aurora/rs485_static_ws/devel/lib/rs485_node/rs485_node /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libpthread.a(pthread_create.o): in function `allocate_stack': /build/glibc-fci4Zo/glibc-2.31/nptl/allocatestack.c:525: undefined reference to `_dl_stack_flags' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/allocatestack.c:525: undefined reference to `_dl_stack_flags' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/allocatestack.c:647: undefined reference to `_dl_stack_flags' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/allocatestack.c:647: undefined reference to `_dl_stack_flags' /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libpthread.a(nptl-init.o): in function `__pthread_initialize_minimal_internal': /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:335: undefined reference to `_dl_pagesize' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:335: undefined reference to `_dl_pagesize' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:344: undefined reference to `_dl_pagesize' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:360: undefined reference to `_dl_init_static_tls' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:362: undefined reference to `_dl_wait_lookup_done' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:360: undefined reference to `_dl_init_static_tls' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:362: undefined reference to `_dl_wait_lookup_done' /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/9/../../../aarch64-linux-gnu/libpthread.a(nptl-init.o): in function `__pthread_get_minstack': /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:393: undefined reference to `_dl_pagesize' /usr/bin/ld: /build/glibc-fci4Zo/glibc-2.31/nptl/nptl-init.c:393: undefined reference to `_dl_pagesize' collect2: error: ld returned 1 exit status make[2]: *** [rs485_node/CMakeFiles/rs485_node.dir/build.make:115: /home/aurora/rs485_static_ws/devel/lib/rs485_node/rs485_node] Error 1 make[1]: *** [CMakeFiles/Makefile2:457: rs485_node/CMakeFiles/rs485_node.dir/all] Error 2 make: *** [Makefile:141: all] Error 2 Invoking "make -j8 -l8" failed
08-04
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值