Comments (3)
You are right. The test which is in the solution
module is restricted to the first 500 integers. I just copied it to make it work, but it should definitely be reported by the author in the exercises modules
from fpinkotlin.
No. The OOME (OutOfMemoryError) is caused by the fact that there is not enough memory to create the list. It is not due to the maximal size of the list. The same error will occur if you try to create a list of Int.MAX_VALUE
elements, which is the maximum size that can be returned by the size
method of an array list.
But it is not the maximum number of elements an array list may contain. It could contain more if there was enough memory, but the size method would then return Int.MAX_VALUE
().
On my computer, the OOME happens after inserting 157 704 907 elements, when the maximum value for size
is 2 147 483 647.
I have fixed the problem with the test in module exercise.
from fpinkotlin.
@pysaumont: Interesting. I didn't know that about array list. Thanks!
from fpinkotlin.
Related Issues (12)
- Ch 9 Working With Laziness Exercise 28 Test Bug
- Inverted tests in the recursion part
- Project won't build with Java 14 (and Gradle 6.1)
- Error in Readme.md HOT 4
- Wrong solution to exercise 4.1
- Problems with the Gradle-Wrapper HOT 4
- missing parentheses in com.fpinkotlin.recursion.FactorialTest HOT 2
- Problem with new Intellij Idea version HOT 2
- I'm not able to run any tests both in Intellij and in using command line HOT 4
- Why did you remove Gradle wrapper? HOT 2
- Test for exercise 4.1 should only test positive Ints HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpinkotlin.