Status Update
Comments
jv...@google.com <jv...@google.com>
je...@google.com <je...@google.com>
ga...@google.com <ga...@google.com> #2
Thanks for filing the bug. To help us debug this, if you are able to consistently reproduce the issue can you please:
- close the IDE
- open only
theory-test-kit
project
- Does Gradle sync finish?
- If "Computing project size" does not finish, can you please try grabbing 4-5 thread dumps (
https://developer.android.com/studio/report-bugs#thread-dump )? - Can you upload
idea.log
of that process? - If you leave it running for longer (e.g. 10mins) does it eventually finish (indexing& "Computing project size")?
Thanks!
pb...@google.com <pb...@google.com> #3
I have also started running into this problem when loading the Chromium source code.
The UI stops on the "Computing project size", and becomes unresponsive, no longer showing the menu when selected. By clicking the close button on the window, I was able to stop the frozen process and make the UI responsive again, which allowed me to export the attached diagnostics report, containing the idea.log and thread dumps
I have also attached a thread dump of the Java threads obtained as mentioned in the link in point 2 above.
ga...@google.com <ga...@google.com> #4
From #3 (at 2024-01-17 16:05:27) UI thread is at:
"AWT-EventQueue-0" #107 prio=6 os_prio=0 cpu=228110.27ms elapsed=634.98s tid=0x00007f9e80120cb0 nid=0x1ddb79 runnable [0x00007f9c583fe000]
java.lang.Thread.State: RUNNABLE
at java.lang.Thread.yield(java.base@17.0.7/Native Method)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.writeLock(ReadMostlyRWLock.java:295)
at com.intellij.openapi.application.impl.ApplicationImpl.startWrite(ApplicationImpl.java:1162)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:942)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:970)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:86)
at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl.lambda$notifyPropertyChanged$3(VirtualFileManagerImpl.java:207)
at com.intellij.openapi.vfs.impl.VirtualFileManagerImpl$$Lambda$4869/0x0000000802af7468.run(Unknown Source)
while Computing project size
is:
at java.util.BitSet.cardinality(java.base@17.0.7/BitSet.java:901)
at java.util.BitSet$1BitSetSpliterator.getFence(java.base@17.0.7/BitSet.java:1253)
at java.util.BitSet$1BitSetSpliterator.tryAdvance(java.base@17.0.7/BitSet.java:1263)
at java.util.Spliterators$2Adapter.hasNext(java.base@17.0.7/Spliterators.java:740)
at com.intellij.util.indexing.containers.BitSetAsRAIntContainer$MyIterator.hasNext(BitSetAsRAIntContainer.java:94)
at com.intellij.psi.search.MappedFileTypeIndex.processFileIdsForFileTypeId(MappedFileTypeIndex.java:57)
at com.intellij.psi.search.FileTypeIndexImplBase.getData(FileTypeIndexImplBase.java:213)
at com.intellij.psi.search.FileTypeIndexImplBase.getData(FileTypeIndexImplBase.java:32)
at com.intellij.util.indexing.FileBasedIndexEx.lambda$getContainingFilesIterator$5(FileBasedIndexEx.java:266)
at com.intellij.util.indexing.FileBasedIndexEx$$Lambda$3154/0x0000000801b73700.convert(Unknown Source)
at com.intellij.util.indexing.FileBasedIndexEx.lambda$processExceptions$6(FileBasedIndexEx.java:322)
at com.intellij.util.indexing.FileBasedIndexEx$$Lambda$3155/0x0000000801b78938.compute(Unknown Source)
at com.intellij.util.ConcurrencyUtil.withLock(ConcurrencyUtil.java:248)
at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:322)
at com.intellij.util.indexing.FileBasedIndexEx.getContainingFilesIterator(FileBasedIndexEx.java:263)
at com.intellij.psi.search.FileTypeIndex.processFiles(FileTypeIndex.java:52)
at com.android.tools.idea.stats.ReportProjectSizeTask.fileCount(ProjectSizeUsageTracker.kt:121)
at com.android.tools.idea.stats.ReportProjectSizeTask.access$fileCount(ProjectSizeUsageTracker.kt:59)
at com.android.tools.idea.stats.ReportProjectSizeTask$run$fileCount$1.call(ProjectSizeUsageTracker.kt:89)
at com.android.tools.idea.stats.ReportProjectSizeTask$run$fileCount$1.call(ProjectSizeUsageTracker.kt:88)
It seems like UI thread cannot get a write lock as ReportProjectSizeTask
holds the read lock, and for for some reason FileTypeIndex.processFiles
takes quite long.
Additionally, UI thread actually wants to deliver an event triggered by change of charset on a VirtualFile
, which is the reason why it blocks.
It seems to me that a fix is to add cancellation check in com.android.tools.idea.stats.ReportProjectSizeTask#fileCount
. Yuriy, you've previously fixed similar issue (
Matthew, do you have an idea why FileTypeIndex.processFiles
would take so long to run?
gh...@google.com <gh...@google.com> #5
Matthew, do you have an idea why FileTypeIndex.processFiles would take so long to run?
No, I'm not sure offhand. Anecdotally, for large projects I've seen FileTypeIndex.processFiles
take 1-10 seconds (usually less for repeated queries, once index data has been cached in RAM).
ga...@google.com <ga...@google.com> #6
Thanks. I've uploaded ag/I0cbee93302b8251c71576ae9c71a0c75f0f7a996 to address this issue and check for cancellations during the file index processing.
ga...@google.com <ga...@google.com> #7
Merged ag/I0cbee93302b8251c71576ae9c71a0c75f0f7a996. It should be out Studio J Canary 6.
an...@google.com <an...@google.com> #8
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Jellyfish | 2023.3.1 Canary 7
- Android Gradle Plugin 8.4.0-alpha07
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
an...@google.com <an...@google.com> #9
The fixes for this issue are now also available in:
- Android Studio Iguana | 2023.2.1 RC 1
- Android Gradle Plugin 8.3.0-rc01
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Description
####################################################
Please provide all of the following information, otherwise we may not be able to route your bug report.
####################################################
1. Describe the bug or issue that you're seeing.
Android Studio Hedgehog hangs on indexing and 'Computing project size'. Even signing out of Windows 11 and back in doesn't help.
Possibly related to
2. Attach log files from Android Studio
2A. In the IDE, select the Help..Collect Logs and Diagnostic Data menu option.
2B. Create a diagnostic report and save it to your local computer.
2C. Attach the report to this bug using the Add attachments button.
3. If you know what they are, write the steps to reproduce:
3A.
3B.
3C.
In addition to logs, please attach a screenshot or recording that illustrates the problem.
For more information on how to get your bug routed quickly, see
Build: AI-231.9392.1.2311.11076708, 202311091610
AI-231.9392.1.2311.11076708, JRE 17.0.7+0-b2043.56-10550314x64 JetBrains s.r.o., OS Windows 11(amd64) v10.0 , screens 1920.0x1080.0
AS: Hedgehog | 2023.1.1
Kotlin plugin: 231-1.9.10-release-459-AS9392.1.2311.11076708
Android Gradle Plugin: 7.4.2
Gradle: 7.5
Gradle JDK: JetBrains Runtime version 17.0.7
NDK: from local.properties: (not specified), latest from SDK: (not found)
CMake: from local.properties: (not specified), latest from SDK: 3.22.1-g37088a8-dirty, from PATH: (not found)
Source: send_feedback_icon```