question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems when printing a 10e6 character String to console

See original GitHub issue

What happened

(please describe what you were doing when this exception occurred)

I wrote this command below 😃 const int printableCharsStartIndex = 32; const int charLength = 1114111 - printableCharsStartIndex; final List<int> charCodes = List.generate(charLength, (index) => index+printableCharsStartIndex); final String chars = String.fromCharCodes(charCodes); print(chars.split(‘’)); FlutterClipboard.copy(chars.split(‘’).toString()).then((value) { print(‘DONE !’); });

Version information

Android Studio Bumblebee | 2021.1.1 Patch 1 • Flutter plugin io.flutter 64.1.2 • Dart plugin 211.7798

Error getting Flutter sdk information.

Exception

null

java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:246)
	at com.sun.proxy.$Proxy34.onTextAvailable(Unknown Source)
	at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:220)
	at com.intellij.execution.process.ColoredProcessHandler.coloredTextAvailable(ColoredProcessHandler.java:63)
	at io.flutter.utils.MostlySilentColoredProcessHandler.coloredTextAvailable(MostlySilentColoredProcessHandler.java:77)
	at com.intellij.execution.process.AnsiEscapeDecoder.processTextChunk(AnsiEscapeDecoder.java:100)
	at com.intellij.execution.process.AnsiEscapeDecoder.escapeText(AnsiEscapeDecoder.java:64)
	at com.intellij.execution.process.ColoredProcessHandler.notifyTextAvailable(ColoredProcessHandler.java:52)
	at com.intellij.execution.process.BaseOSProcessHandler$SimpleOutputReader.onTextAvailable(BaseOSProcessHandler.java:156)
	at com.intellij.util.io.BaseOutputReader.sendText(BaseOutputReader.java:206)
	at com.intellij.util.io.BaseOutputReader.processInput(BaseOutputReader.java:190)
	at com.intellij.util.io.BaseOutputReader.readAvailableBlocking(BaseOutputReader.java:137)
	at com.intellij.util.io.BaseDataReader.readAvailable(BaseDataReader.java:68)
	at com.intellij.util.io.BaseDataReader.doRun(BaseDataReader.java:158)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
	at com.intellij.util.io.BaseDataReader.lambda$start$0(BaseDataReader.java:51)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.OutOfMemoryError: Java heap space

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stevemessickcommented, Mar 28, 2022

I wasn’t able to exactly reproduce the problem, but I did cause Android Studio to become unresponsive. I think trying to print a million-character string broke it. I did not get an exception but I had to force-quit Android Studio.

0reactions
abdulrojakdevcommented, Aug 12, 2022

@jacob314 I’m tempted to close this issue. Is this use-case something we want to encourage? The user is using a Flutter app to print a million characters to the console in the IDE.

0410BDCD-DFE8-4A35-B5FB-54DB58FDFC7D

Read more comments on GitHub >

github_iconTop Results From Across the Web

Print unicode string to console OK but fails when redirect to a ...
The complication is that print must re-encode that object into a byte stream before writing it. It looks like in your case the...
Read more >
Code passes, yet does not print to console. Not sure where I ...
Hey I'm having similar problems, only mine prints perfectly but it still gives me an error message, “It looks like your speak method...
Read more >
Print statement - Personal Psu
It contains a combination of a character string and a variable ( v1 ). A comma like the one that separates the character...
Read more >
3 Formatting Text and Numbers | Handling Strings with R
A common task when working with character strings involves printing and ... Other functions are useful for printing output either in the R...
Read more >
Print Function and Strings - Python Programming Tutorials
The print function in Python is a function that outputs to your console ... this specific problem, but one of them would be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found