<BlaXpirit>
oh well, i just ignored the part about the constant and it works fine
buggs has quit [Read error: Connection reset by peer]
havenwood has quit [Ping timeout: 248 seconds]
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
havenwood has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
matp has quit [Quit: Bye!]
matp has joined #crystal-lang
Nik736 has joined #crystal-lang
Nik736 has quit [Client Quit]
matp has quit [Read error: Connection reset by peer]
matp has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
pawnbox_ has quit [Ping timeout: 248 seconds]
<asterite>
BlaXpirit: maybe a bit late, but you can do pointerof(struct.@ivar)
<BlaXpirit>
asterite, it's a lib struct, that didnt work
<BlaXpirit>
and it turned out to be pointless anyway. i just can't tell the garbage collector that this particular pointer shouldn't keep a reference alive
ponga has joined #crystal-lang
<FromGitter>
<sdogruyol> How would i start GC?
<FromGitter>
<sdogruyol> GC.start?
<FromGitter>
<sdogruyol> seems like GC.collect
<FromGitter>
<sdogruyol> @RX14 i'm trying the multipart stuff with big file ~ 1GB
<RX14>
yes
<FromGitter>
<sdogruyol> and the memory just leaks
<FromGitter>
<sdogruyol> even GC.collect doesnt work
<RX14>
can you show me your code?
<RX14>
oh
<RX14>
yes
<FromGitter>
<sdogruyol> sure
<RX14>
i know why
<RX14>
it's crystal's HTTP
<RX14>
it buffers the whole request
<FromGitter>
<sdogruyol> ugh
<RX14>
doesn't support streaming
<FromGitter>
<sdogruyol> that means it allocates for each request
<RX14>
so there's this massive allocation for the whole file
<RX14>
the whole 1GB
<FromGitter>
<sdogruyol> ultimately leading to crash
<FromGitter>
<sdogruyol> yeah
<RX14>
that obviously gets reused by the GC
<RX14>
so can't be freed
<RX14>
if you upload again and again you should see the memory remain constant but large
<RX14>
so not a leak just a large peak
<FromGitter>
<sdogruyol> yeah it stay at around 5GB
<RX14>
yeah wow thats a lot
<FromGitter>
<sdogruyol> which makes me sad :/
<FromGitter>
<sdogruyol> and i'm not even talking about without --release
<RX14>
shouldn't make a difference
<FromGitter>
<sdogruyol> so we need to rewrite Crystal HTTP for this?
<RX14>
yes
<RX14>
i started
<RX14>
but never got far
<FromGitter>
<sdogruyol> wow, that's cool
<FromGitter>
<sdogruyol> so it's easy to DDOS for now
<FromGitter>
<sdogruyol> :(
<RX14>
yeah
Philpax has quit [Ping timeout: 272 seconds]
<BlaXpirit>
the garbage collector is really getting on my nerves tho
<RX14>
the garbage collecter doesn't deal well with big allocations, thats what the warnings are about
<RX14>
the garbage collector's always been good to me
<BlaXpirit>
yeah.. i can probably afford to drop that call :p
<FromGitter>
<sdogruyol> shit, i just tried file upload stuff with Go STD and it constantly stay at 5MB with same benchmark
<FromGitter>
<sdogruyol> i'm amazed
<RX14>
well, if we rewrote HTTP we could probably get a similar result
<RX14>
and not full rewrite
<RX14>
split it into http/client and http/server with a http/common
<RX14>
http::server::Response already streams out
<RX14>
just not in
<RX14>
there's a lot that can be reused
<asterite>
When I didn't want to merge the multipart PR I mentioned that it doesn't make sense without a streaming http server...
<RX14>
yes
<RX14>
well, it doesn't make sense either
<asterite>
I'll try to work on that next (besides threads, of course)
<RX14>
any publicall-exposed crystal HTTP server can be brought down with a largew HTTP request
<RX14>
I think thats a big problem
<asterite>
BlaXpirit: maybe you can use WeakRef
<RX14>
thats a massive problem, with an easy explot which means crystal absolutely *can* not be used in production
<BlaXpirit>
asterite, yeah I know but it's a whole class
<BlaXpirit>
i'm playing with fire here, I'm relying on the garbage collector to look at pointer which are in lib structs
<BlaXpirit>
works quite well, other than these cycles
<BlaXpirit>
but really, what can you do. a simulation contains a shape and a shape needs a way to access the simulation, so the cycle is natural. unfortunately, not all shapes work well without a finalizer
<BlaXpirit>
polygon shape allocates a dynamic array of points and needs to free it
<BlaXpirit>
i have a finalizer only in 1 class now, but GC still says GC Warning: Finalization cycle involving 0x212cd20
<BlaXpirit>
how can I diagnose this?
OmgBBQ has joined #crystal-lang
<OmgBBQ>
Hey! Quick question for you guys. I have a date under this format "2016-10-04T15:15:07Z" that is being returned from a JSON response. The format is ISO 8601, using the %F flag in my "JSON.mapping" only retrieves the date. I'd like to also retrieve the time, I can't seem to figure out the correct time format for it to work. Any help?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
Raimondii has joined #crystal-lang
pawnbox has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<johnjansen> @OmgBBQ check the specs 'spec/std/json/mapping_spec.cr' for hints ... I found this '''private class JSONWithTime ⏎ JSON.mapping({ ⏎ value: {type: Time, converter: Time::Format.new("%F %T")}, ⏎ }) ⏎ end''' [https://gitter.im/crystal-lang/crystal?at=57f3d336d45d7f0f5260ee8b]