Exhausted heap space

243 views
Skip to first unread message

Peter Jakobs

unread,
Jul 16, 2014, 9:13:20 PM7/16/14
to mi...@dartlang.org
Currently running into this Exception: Exhausted heap space
I wrote two Transformer if I run each one single everything runs fine, but if I run both in a Transformgroup it fails with "Exhausted heap space" at some point.
Is there a solution for this, or is there something wrong with my code?

Bob Nystrom

unread,
Jul 17, 2014, 2:03:02 PM7/17/14
to General Dart Discussion

On Wed, Jul 16, 2014 at 6:13 PM, Peter Jakobs <p4j...@gmail.com> wrote:
Is there a solution for this, or is there something wrong with my code?

The basic follow-up question is, is your transformer allocating a lot of memory? :)

You should be able to run multiple transformers in a group without any problems, and we have other transformers that do just that.

- bob

Peter Jakobs

unread,
Jul 17, 2014, 7:05:20 PM7/17/14
to mi...@dartlang.org
I combined the two transformers into one.. and it works now...

Shameless plug: Is there a way that Transformers defined in the pubspec (of one library) can transform libraries of other packages too (with "pub build")?

- Peter

Bob Nystrom

unread,
Jul 17, 2014, 8:24:10 PM7/17/14
to General Dart Discussion

On Thu, Jul 17, 2014 at 4:05 PM, Peter Jakobs <p4j...@gmail.com> wrote:
Is there a way that Transformers defined in the pubspec (of one library) can transform libraries of other packages too (with "pub build")?

A transformer can read assets as secondary inputs from any package it likes. However, the primary inputs and any assets it outputs have to be in the same package where the transformer is specified.

The reason is that each package has its own independent set of transformer phases. If transformers could write outputs to other packages, it's impossible to determine which phase in the receiving package should see those outputs.

- bob

Peter Jakobs

unread,
Jul 19, 2014, 1:51:04 PM7/19/14
to mi...@dartlang.org
Okay, so I just add the transformer to each package that needs transforming.
But it still does the wrong thing. The secondary inputs gets transformed but the transformed code does not land in the "build" folder (only the untransformed code).

"pub build" for this library:

name: harmony3d_example

transformers:

- mist <- gets applied and transformed code appears that way in the „build“-folder


used packages:

name: harmony3d

transformers:

- mist <- gets applied but only untransformed code appear in the „build“-folder

name: mist

transformers:

- mist/src/build/mist_static_transform <- gets applied and transformed code appears that way in the „build“-folder


Also, is there a way to do transformation only on "pub build"?
 

Bob Nystrom

unread,
Jul 21, 2014, 1:50:27 PM7/21/14
to General Dart Discussion
On Sat, Jul 19, 2014 at 10:51 AM, Peter Jakobs <p4j...@gmail.com> wrote:
The secondary inputs gets transformed but the transformed code does not land in the "build" folder (only the untransformed code).

How do you know they get transformed? Just from the logs? What outputs does it produce?
 
Also, is there a way to do transformation only on "pub build"?

I'm not sure what you mean by this. Can you give me some more details?

- bob

Arron Washington

unread,
Jul 21, 2014, 10:16:44 PM7/21/14
to mi...@dartlang.org
https://www.dartlang.org/tools/pub/transformers/#define-asPlugin

According to the documentation, by default the mode is 'debug' when `pub serve` is executing a transformer and 'release' when `pub build` is running a transformer.

Günter Zöchbauer

unread,
Jul 22, 2014, 2:07:38 AM7/22/14
to mi...@dartlang.org
It was mentioned a few times in some issues that (some?) transformers in "pub serve" should only be executed when JavaScript source is requested but not when a request is made from Dartium but I couldn't find the issues.
 
- bob

Günter Zöchbauer

unread,
Jul 22, 2014, 2:51:08 AM7/22/14
to mi...@dartlang.org

Peter Jakobs

unread,
Aug 6, 2014, 4:22:10 PM8/6/14
to mi...@dartlang.org
So my problem is, the BarbackSettings passend to my transformer is always holds the value for debug and not for release. Does not matter if its pub build oder pub serve 

class MyTransform extends Transformer {
  final BarbackSettings _settings;

  MyTransform.asPlugin(this._settings);

Bob Nystrom

unread,
Aug 6, 2014, 6:42:26 PM8/6/14
to General Dart Discussion

On Wed, Aug 6, 2014 at 1:22 PM, Peter Jakobs <p4j...@gmail.com> wrote:
So my problem is, the BarbackSettings passend to my transformer is always holds the value for debug and not for release. Does not matter if its pub build oder pub serve 

Do you see the same thing if you pass in the mode explicitly, like:

$ pub serve --mode release
$ pub build --mode something_crazy

Etc.?

- bob

Peter Jakobs

unread,
Aug 10, 2014, 10:07:10 AM8/10/14
to mi...@dartlang.org
This works fine! Can we please get that integrated in the editor?

- Peter 

Bob Nystrom

unread,
Aug 12, 2014, 3:40:57 PM8/12/14
to General Dart Discussion

On Sun, Aug 10, 2014 at 7:07 AM, Peter Jakobs <p4j...@gmail.com> wrote:
This works fine! Can we please get that integrated in the editor?

Can you see if there's a bug for this? If not, please file one.

Thanks!

- bob

Peter Jakobs

unread,
Aug 12, 2014, 5:17:13 PM8/12/14
to mi...@dartlang.org
Could not find a bug, so here it is:
Reply all
Reply to author
Forward
0 new messages