Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
29736f6f
Unverified
Commit
29736f6f
authored
May 27, 2020
by
Zachary Anderson
Committed by
GitHub
May 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Put a heap size limit on the frontend_server (#58039)
parent
e7661905
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
compile.dart
packages/flutter_tools/lib/src/compile.dart
+10
-0
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+14
-0
compile_batch_test.dart
.../flutter_tools/test/general.shard/compile_batch_test.dart
+31
-0
No files found.
packages/flutter_tools/lib/src/compile.dart
View file @
29736f6f
...
...
@@ -263,6 +263,11 @@ class KernelCompiler {
}
final
List
<
String
>
command
=
<
String
>[
engineDartPath
,
'--disable-dart-dev'
,
// This limit is in place to help track down
// https://github.com/flutter/flutter/issues/54420. It should be removed
// when the underlying issue is identified and fixed.
'--old_gen_heap_size=2000'
,
frontendServer
,
'--sdk-root'
,
sdkRoot
,
...
...
@@ -648,6 +653,11 @@ class DefaultResidentCompiler implements ResidentCompiler {
);
final
List
<
String
>
command
=
<
String
>[
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
// This limit is in place to help track down
// https://github.com/flutter/flutter/issues/54420. It should be removed
// when the underlying issue is identified and fixed.
'--old_gen_heap_size=2000'
,
frontendServer
,
'--sdk-root'
,
sdkRoot
,
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
29736f6f
...
...
@@ -86,6 +86,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
@@ -115,6 +117,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
@@ -144,6 +148,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
@@ -174,6 +180,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
@@ -206,6 +214,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
@@ -236,6 +246,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
@@ -278,6 +290,8 @@ void main() {
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
<
String
>[
artifacts
.
getArtifactPath
(
Artifact
.
engineDartBinary
),
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
artifacts
.
getArtifactPath
(
Artifact
.
frontendServerSnapshotForEngineDartSdk
),
'--sdk-root'
,
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
)
+
'/'
,
...
...
packages/flutter_tools/test/general.shard/compile_batch_test.dart
View file @
29736f6f
...
...
@@ -76,6 +76,37 @@ void main() {
Platform:
kNoColorTerminalPlatform
,
});
testUsingContext
(
'passes VM heap size limit'
,
()
async
{
when
(
mockFrontendServer
.
stdout
)
.
thenAnswer
((
Invocation
invocation
)
=>
Stream
<
List
<
int
>>.
fromFuture
(
Future
<
List
<
int
>>.
value
(
utf8
.
encode
(
'result abc
\n
line1
\n
line2
\n
abc
\n
abc /path/to/main.dart.dill 0'
))
));
final
KernelCompiler
kernelCompiler
=
await
kernelCompilerFactory
.
create
(
null
);
final
CompilerOutput
output
=
await
kernelCompiler
.
compile
(
sdkRoot:
'/path/to/sdkroot'
,
mainPath:
'/path/to/main.dart'
,
buildMode:
BuildMode
.
debug
,
trackWidgetCreation:
false
,
dartDefines:
const
<
String
>[],
packageConfig:
PackageConfig
.
empty
,
packagesPath:
'.packages'
,
);
expect
(
mockFrontendServerStdIn
.
getAndClear
(),
isEmpty
);
expect
(
testLogger
.
errorText
,
equals
(
'
\n
Compiler message:
\n
line1
\n
line2
\n
'
));
expect
(
output
.
outputFilename
,
equals
(
'/path/to/main.dart.dill'
));
final
VerificationResult
argVerification
=
verify
(
mockProcessManager
.
start
(
captureAny
));
expect
(
argVerification
.
captured
.
single
,
containsAll
(<
String
>[
'--disable-dart-dev'
,
'--old_gen_heap_size=2000'
,
]));
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
OutputPreferences:
()
=>
OutputPreferences
(
showColor:
false
),
Platform:
kNoColorTerminalPlatform
,
});
testUsingContext
(
'passes correct AOT config to kernel compiler in aot/profile mode'
,
()
async
{
when
(
mockFrontendServer
.
stdout
)
.
thenAnswer
((
Invocation
invocation
)
=>
Stream
<
List
<
int
>>.
fromFuture
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment