sattvik / clojure Goto Github PK
View Code? Open in Web Editor NEWThis project forked from clojure/clojure
The Clojure programming language
Home Page: http://clojure.org
This project forked from clojure/clojure
The Clojure programming language
Home Page: http://clojure.org
Per default newly created threads have a stack size of 8kb on Android/Dalvik which is a lot less than the usual 256-512 kB on a 'normal' JVM. This limit is easily hit when e.g. "eval"-ing moderately complex expressions.
In places where one is in control of creating new threads in one's own project one can easily use the Thread constructor that allows one to specify a stack size. However Clojure creates threads implicitly, e.g. for agents.
Changing createThreadFactory in clojure.lang.Agent fixes this:
private static ThreadFactory createThreadFactory(final String format, final AtomicLong threadPoolCounter) {
return new ThreadFactory() {
public Thread newThread(Runnable runnable) {
return new Thread(Thread.currentThread().getThreadGroup(),
runnable, String.format(format, threadPoolCounter.getAndIncrement()), 256 * 1204);
}
};
}
This could be amended to only explicitly set the stack size explicitly if the DalvikVM has been detected and leave it to the default otherwise.
Using alexander yakushev's version of neko and [android/clojure "1.5.0"] in project.clj, the android app I'm building fails to build on the DEX creation stage.
Since java6 is needed for Android I added the forkjoin lib ([org.codehaus.jsr166-mirror/jsr166y "1.7.0"]) to project.clj but I get an OutOfMemoryError when creating the DEX file:
UNEXPECTED TOP-LEVEL ERROR: java.lang.OutOfMemoryError: Java heap space at com.android.dx.cf.code.ExecutionStack.(ExecutionStack.java:55) at com.android.dx.cf.code.ExecutionStack.copy(ExecutionStack.java:66) at com.android.dx.cf.code.Frame.copy(Frame.java:98) at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:683) at com.android.dx.cf.code.Ropper.doit(Ropper.java:639) at com.android.dx.cf.code.Ropper.convert(Ropper.java:252) at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:256) at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:134) at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:87) at com.android.dx.command.dexer.Main.processClass(Main.java:487) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459) at com.android.dx.command.dexer.Main.access$400(Main.java:67) at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109) at com.android.dx.command.dexer.Main.processOne(Main.java:422) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333) at com.android.dx.command.dexer.Main.run(Main.java:209) at com.android.dx.command.dexer.Main.main(Main.java:174) at com.android.dx.command.Main.main(Main.java:91)
BTW: I tried using JVM args on my desktop to increase stack and heap sizes to no avail.
Hello
I am trying to convert the tutorial http://developer.android.com/guide/topics/graphics/opengl.html to Clojure using the fork I found on this site (also using the main 1.4 release but with the same result)
The issue is that the onTouchEvent is behaving very slow.
Logcat says
05-06 11:03:30.680: INFO/InputDispatcher(170): Application is not responding: Window{4143d7f0 com.example/com.example.Activity paused=false}. 9270.0ms since event, 5001.9ms since wait started
05-06 11:03:30.680: INFO/WindowManager(170): Input event dispatching timed out sending to com.example/com.example.Activity
Might be related to how Clojure generates separate java class per overridden/implemented method, but I have no real clue
Any tips would be warmly welcomed as currently, my planned pet project to play around with opengl on android using Clojure seems pretty unworkable
Many thanks
Peter
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.