Welcome back to our lecture series Math 12-10, Calculus 1 for students at Southern Utah University. As usual, I'll be your professor today, Dr. Andrew Misseldine. In this lecture 12, we're going to begin our conversation of continuity. This will also extend into lecture 13 in this lecture series. Now, before we define what continuity is properly, I want to actually present you an example of something that is not continuous. That is what we call a discontinuous function. That's because in reality, to appreciate something, we have to see examples of the thing that we're studying, but we have to have to see counter examples. That is what doesn't have that property. It's only in the opposition and in contrast, do we truly understand what something is? We have to see what it's not as well. You don't really know what it's like to feel healthy until you felt unhealthy. You don't know what it feels like to not be hungry until you actually feel hunger. We're going to talk about some discontinuous things first. Imagine the following scenario here. We have a trailer rental firm that charges a flat $8 fee to rent a hitch. Then the trailer itself is rented for $22 a day. This will count for any fraction of the day. If you were to rent the trailer for just an hour and then you return to that same data, it still charge you for the whole day, $22. Let's see if X be the cost function associated to renting a hitch and a trailer for X number of days. If we were to graph this, then we would see something like the picture we see down below, which if you were to rent the trailer for zero days, they would charge you nothing. You didn't take their service. Negative number of days of rental would not make sense. Clearly, negatives will be outside the domain of this function, but any non-negative number would make sense. That does include fractions, decimals, irrational numbers even as well. You potentially could rent a trailer for the square root of two of a day. I mean, that precision might be like, well, that's weird, but that is perfectly reasonable. We could rent a trailer for 1.4 days or what have you, because again, it doesn't matter how much portion of a day you rented, you'll get charged for the whole day if you go past 0.0 in that consideration. For zero days, you could charge nothing. Well, if you were to rent the trailer for any fraction of one day, but any fraction of one day, you're going to get charged $30. Where did the $30 come from? Well, you have the $8 rental fee, the flat fee for the hitch, and you had charged one day for the trailer, so 8 plus 22 is 30.  If you turned it in any time, if you returned the trailer any time before they closed on that day, you would get charged that same fee. But then if you overlap to the second day, whether an hour or the whole day or anywhere in between, you're going to get charged this right here. You're going to get 30 plus 22, which is going to be the $52, whether you see it right here. And so you see there's this type of jump that you went from one day to the second day. There was no sort of nothing in between. There's no way our function could hit anything above 30 below 52. It jumped from $30 to $52. And we see the same thing happen when you hit the third day. If you use any portion of the third day, you're going to get charged another $22 of rental fees there. And so that's going to give you 74 on the third day. And again, any portion of the third day up until the end of the third day. If you rent the trailer any portion of the fourth day, you'll jump again, in which case now we're looking at $96. If you use any portion of the fourth day, then you'll add another $22 and you get $118. And imagine we keep on going, going, going. You're going to get these little segments that look something like this that just repeats over and over and over again. And it'll have this incremental jump of $22 each and every time you do it. Now, when you look at any sector of this graph, you're going to see these segments that look something like the following. It's going to be a flat line that is the Y coordinate will not change. You have a solid dot at the very end, but you have an open dot at the very beginning. Why is that? Well, at the end, so these solid dots represent the end of each day, right? So if you submitted the trailer at the end of day three, then you'd be charged $74. The jump doesn't happen until you go just past, right? You know, so if you take C of three, that's going to equal 74.  And so we have this open dot on the graph here to represent that while we can get arbitrary close to this point, this point's not included on the graph. This is the function value when X equals four. This is the function value when X equals three. This is the function value when X equals two, not this point right here. But let's consider the limits of these things for a moment. Like if we were to consider X equals two right here, if we asked ourself what C of two is, well, according to the rule here, that C of two is going to be $52 because you get charged $8 for the hitch, and then you'll be charged 22 times two for the two days that you've done there, in which case, so C of two is $52. If I asked you what the limit as X approaches two from the right is of our function C of X, we would see something like, okay, as you get closer and closer to, on the right-hand side, you're gonna get closer and closer to this Y coordinate, which is actually on the upper step here, which is gonna be 74. But on the other hand, you're gonna get the limit if you take it from below, that as you approach two from the left, you're gonna get closer and closer and closer to something like this, C of X here, that case is gonna be 52. So what this has to tell us about the limit is that X approaches two of this function C of X, we see that the limit does not exist because the right limit and the left limit don't agree with each other. But you see that for each positive integer in the domain, there's this jump, right? And that jump is actually characterized by this disagreement with the left-hand and the right-hand limits. The left-hand limit agrees with the function, but the right-hand limit agrees with what the next step on this sort of staircase is going to be. So we jump from 52 to 74. And so this is an example of what we call a discontinuity. There's some disagreement between what the function is doing and what the limit expects the function to be doing. A discontinuity would be the absence of continuity. So let's define what that means properly because graphs will sometimes have like this one, jumps or rips or holes, some type of graphical break on the graph. And this will cause the limit to either not exist or to disagree with the function itself. And so discontinuities are about measuring holes in a graph. And so hence a continuous function will be one that doesn't have these type of holes. All right, so let's define what we mean by a continuous function properly. We say that a function F is continuous at some number X equals C. So C is a specific number in the domain of the function F. We say a function's continuous at the point X equals C if the following three things have to hold. So again, these three things have to hold. So the first one is that F of C is defined. This suggests that X equals C is in fact a number in the domain of the function F. So the function has to be defined at the number in order to be continuous. You cannot be continuous outside of your domain. The next thing we need is that the limit as X approaches that number C for F of X must exist. So like the previous example, all of those integer values X equals one, X equals two, X equals three, all of those integer values, the function was defined at them but the limit didn't exist. And that's why it wasn't continuous at those points. So the function has to be defined. The limit has to exist. And then the third kicker, this is the most important part, the limit has to agree with the function. So F of C, this is the function's definition. This is the function assignment. This is what the function is at X equals C. On the other hand, the limit is the expectation. It's the trend. What will we expect the function to do when we look at points near X equals C? And so for a function to be continuous, it needs to do what it's expected to do. So functions which are continuous are not the rebellious teenagers.  You don't understand me, mom and dad. So when you defy your expectations, that's when you are discontinuous. A continuous function does exactly what it expected to do. And so properly defined, if a function's not continuous at C, we say it's discontinuous at C, or we'd say there's a discontinuity at X equals C. Now, continuous functions get their name because of the following geometric principle. A function is continuous if you could graph the function with one continuous stroke of your pen. That is to say you never have to pick up your pen in order to draw the graph in the XY plane. That doesn't mean you don't have to take pauses, right? There might be like some piecewise functions that fundamentally shift their behavior at these switching numbers. That's okay. It's still as continuous if we can be drawn with no time that you have to pick up your pen. That is one continuous stroke. Now, as continuity is defined using limits, we can also talk about what it means for a function to be continuous from the right, or sometimes we say it's right continuous, to be continuous from the right, well, F of C needs to be defined. The limit as X approaches C from the right has to exist, and the limit as X approaches C from the right has to agree with the function. So it's sort of a weaker form of continuity. Your continuous from the right, if the right handed limit tells you what the function's actually doing. Similarly defined, we can talk about what it means to be continuous from the left or left continuous. What that would mean is the function's defined. The limit as you approach C from the left agrees with the function. So if a function's continuous, it's both right continuous and left continuous, but you can't have a function which is right continuous but not left continuous and vice versa. And of course, you can have a function which is not continuous at all, of course. Going back to this example, this is an example of a function which is gonna be left continuous. It's left continuous. Why is that? Well, notice that when you take any integer value, you're gonna have a function will notice that when you take any integer value, it's gonna be, it's going to be defined. So the function is defined. If you take the left handed limit, the left handed limit exists and agrees with the function. That's why we're left continuous. This is a left continuous function. Now, of course, if you pick any decimal, you know, non-integer and number of the domain right here, then it'll be continuous at that point, right? So the approach from the left and from the right agrees with the function. So this function is left continuous on integers and it's gonna be continuous on, well, non-integers in its domain. And so this kind of step function, as they're sometimes called, they have this property that you're gonna be continuous when you're not near step. And then you might be left or right continuous at the step based upon what the function is doing. You definitely won't be continuous at a step because a discontinuity is what we're seeing when we talk about these steps right here. We can also talk about what it means to be continuous on an open interval. So we say function is continuous on an open interval A to B if it's continuous at each X value in that interval A to B right there. And so similarly, you could talk about being left continuous or right continuous on an interval. The definitions are defined analogously. We can also talk about what it means for a function to be continuous on a closed interval. This one we have to be a little bit more careful about. If you're continuous on a closed interval A to B, that means you'll be continuous on the open interval A to B. You'll be right continuous at X equals A and you'll be left continuous at X equals B. Because the point is if you to the left of X equals A that's outside the interval so we don't care what's going on there. So as you approach X from the right because you can't approach it from the left in this interval, that you don't have to be right continuous the same thing for left continuous there. So that's what it means to be continuous on an interval. Now the good news is that the types of functions we typically run across in calculus, particularly the functions we run across in pre-calculus for the most part are continuous functions. That is they're continuous on their domains because outside your domain you can't be continuous but for most of the functions we run across in calculus that is the pre-calculus functions those are gonna be continuous on their domains. So this would include things like polynomials. Any polynomial function is gonna be continuous for all real numbers because a polynomial function, a polynomial function's domain is all real numbers. A polynomials are continuous for all real, for all numbers in its domain. The significance of this is that since a function's continuous this means that the limit as X approaches C of F of X is equal to F of C. When a function is continuous you can compute its limit just by evaluating the function which is a very, very nice calculation. And as we computed limits earlier in this lecture series oftentimes that's how we did it. We were able to evaluate the function and get the limit. That's what we do with continuous functions because the expectation aka the limit is just what the function is doing the function evaluation there. Polynomials are continuous.  Now I have to say that they're continuous on their domains which the domain of a rational function will be all numbers that make the denominator non-zero. So if the denominator goes to zero there are potential discontinuities and I guess I should say there are definite discontinuities because if the denominator goes to zero the functions are defined and that's required to be continuous there. So as we start searching for discontinuities of a rational function we're gonna be interested in what numbers make the denominator go to zero there. Let's imagine you have like a square root function f of x equals the square root of x. This function will be continuous on its domain zero to infinity. And like we talked about before that means we're gonna be right continuous at x equals zero. Similar properties can be said for other radical functions cube roots, fourth roots, fifth roots, et cetera. If y equals the cube root of x it'll be continuous for all real numbers. If we take a general power function x to the a right here where x is a variable a is some constant, right? A power function will be continuous on its domain. Now there are some potential concerns, right? Because if you take like y equals one over x that's a rational function so therefore there will be a discontinuity when x equals zero. We talked about the square root of x just a moment ago as well. Because this is a domain concerns there might be some discontinuities associated to that but power functions will be continuous on their domains. Switching over to exponential functions we swap the role of base and exponent there for an exponential function the base is a constant the exponent is the variable. An exponential function so long as the base is positive it'll be continuous for all real numbers because its domain is all real numbers it'll be continuous there. For a logarithm base A so long as the base is positive and not one because otherwise the logarithm is not well defined for logarithms they're gonna be continuous on their domains which with no transformations whatsoever a logarithm's domain will be zero to infinity. Now as you get to the end of the domain at zero you'll notice I did not say that it was continuous here because there's concerns that the logarithm's not defined at zero and in fact as we will see later on a logarithm has a vertical asymptote at that value x equals zero. For trigonometric functions they're continuous on their domains inverse trigonometric functions are continuous on their domains and in fact any function we can create by combining these functions so as we add together subtract, multiply, divide, compose these types of functions we can create new functions from them they will be continuous on their respective domains.


From around the globe, it's theCUBE with digital coverage of OutSystems Next Step 2020 brought to you by OutSystems. Hi, I'm Stu Miniman and this is theCUBE's coverage of OutSystems Next Step 2020. And we love when we get to be able to talk to the practitioners when we come to these events and happy to welcome to the program. First time, Gress, Bruce Bottles, he is the Digital Channels Director at Humana. I gave a presentation this year, also last year at the physical event. Bruce, thank you so much for joining us. Great to have you on theCUBE. Hey, Stu, thanks so much for having me. It's a pleasure to be here. All right, so Bruce, Humana, a company that, you know, most people probably are familiar, you know, healthcare of course, super important in general and even more so in 2020. But if you could just set up for us a little bit, how should we think of Humana these days, your role inside the organization? And then we'll get into the discussion from there. Yeah, it's a great point, you know, because Humana is and has been going through a pretty significant transformation. And one of the big reasons why I joined Humana about two and a half years ago was this goal to go from just an insurance company to really a full service healthcare company. So to now we're really bridging the gateway where we're almost half of our staff, our caregivers, our doctors and nurses and clinicians and the other half of us kind of run the business. So my role is digital channels as you would expect, leading up efforts across humana.com, our mobile apps, go through 65 and other fitness and wellness apps as well as pharmacy business. So good question. Awesome, Bruce, I tell you, one of the, my favorite conversations over the last few years has been that discussion, you know, digital transformation, it was a buzzword. It gets a little bit overused, but from our standpoint, the companies that are doing it, you know, data is centrally important. We understand what we're doing. We're leveraging modern technologies and platforms out there.  What are some of the key important pieces along that journey? Yeah, that's a great point because I do think digital transformation, unfortunately, is a little bit overused and like most technology waves can be hyped, you know, but the reality is for us at Humana is that, you know, our heart truly desires to reach our customers in new and better ways is to meet their needs not only that we know they have today, but to anticipate and forecast what those needs are going to be tomorrow and start building those solutions today for what we know they're going to need in the near future. So one of the challenges that I saw when I came to the company a couple of years ago was just the quality and the speed and ability to react to new opportunities and unforeseen circumstances and challenges is that ability to move very quickly. To me, that's one of the keys to digital transformation is that outcome, is speed and quality. Well, you know, Bruce, absolutely, you know, when 2020 hit, the commentary we had is those companies that have already gone down this journey, as you say, agility, being able to react really fast are happy that they've done it and anybody that hadn't really started down or gone fast were like, oh my gosh, I need to get there fast because obviously 2020 brought a lot of new challenges in place. I want to hold off one minute longer before talking about the specific 2020 challenges because you've got a great story there but out systems, you've been a partner with them, you spoke last year at the conference, why don't you bring us back as to how they first got involved and what was the plan pre 2020? Yeah, so my journey has been interesting. I've been a partner of out systems for about six years now actually and one of the reasons I came to Humana was the opportunity to introduce the company to a new way to this low code concept. I had used out systems to start a couple of companies prior to Humana and about 18 months ago we actually signed a first contract at Humana without systems. So what we really are enjoying now is this new opportunity to move quickly to build things differently and to respond to those, like I said, those opportunities that we maybe didn't have before. So that's my journey without systems that didn't start with Humana but have really enjoyed working with them over the last six years. Well, as you said, that ability to react fast is something that's been the promise of platforms, of clouds and the like. Well, 2020, you need to react fast. So Bruce, enough setup, I guess. Why don't you tell us how COVID-19, the impact, what you and your team needed to do to kind of move fast and get to what the internal as well as external customers we're going to need. Yeah, thanks for the intro. You know, really, let me take it back just a little bit to 2019. So in 2019, we realized that one of our top five interactions that our customers do is they come to our websites and our apps looking for a doctor or looking for a hospital or clinic or a pharmacy, an eye doctor, a dentist, et cetera. It's one of the top five interactions on our site. And what we realized is that it was a very disjointed experience. It had been grown up over years, not uncommon to most Fortune 50 companies. And it was a silo. If you wanted to find a medical doctor, it was different than if you wanted to find a vision doctor. And it was different if you wanted to find a pharmacy, et cetera. So not only was it a different experience for customers, but there were different technical solutions and the cost of maintaining those disparate solutions was really prohibitive to us innovating. So I set forth the strategy since I was the business owner of this capability of finding a doctor, I set the roadmap and said, we're going to unify them all. So that was our original challenge is to unify all of these finders to do a single provider finder. Well, that was going great. And right about the end of February, we had a pharmacy finder was the first one. And then COVID hit in March. And thank goodness it did hit then because we were ready to respond to one of the most important things our customers asked for. And that is, help me find a place to get a COVID-19 test. We had a giant spreadsheet that the call center was trying to maintain and manage and answer those calls as they would come in and say, hey, help me find a location to get a test. Well, if you know anything about COVID testing, it changes constantly. The testing locations change constantly. The type of tests they have, the supplies that they have, the hours of operations. So it was a daunting task, to say the least. So that's when I stood up and said, hey, can we volunteer? Can we gather a bunch of volunteers to quickly build some solutions that'll help not only the call center, but to help our customers serve themselves? So that's really where this COVID-19 test location came from. It was out of the genesis of what we had started doing on the provider finder space. Yeah, I'm curious, Bruce. I know you gave a presentation here at the event, kind of walk through what you had to build, but if you were to look at it, how long did it take to build the COVID test finder? And you've got lots of experience without systems. If you had not already started on this back in 2019, if you had just said, okay, I've got a spreadsheet. I need to bring in a technology. If I started from scratch, how much longer do you think it would have taken for your team to be able to react to deploy this new solution? Yeah, that's a great question. And one of the key victories I think we had is, honestly, the first challenge that I mentioned, the spreadsheet, we solved that spreadsheet problem in a weekend. So I pulled together some volunteers. I was one of them. And we actually built the replacement for the spreadsheet in a weekend. So that was pretty astounding. So the call center was grateful for that. And they quickly had a very unique solution there. But that was really just the touching point. Where we then took it to is building on top of this unified provider finder. We said, well, do you know what? The COVID-19 testing locations are in a sense, just another type of provider. So with that perspective, we started building a full back office suite where we had a team of 30 to 40 analysts, constantly looking across the United States and validating testing location information. Hours of operation, calling them, making sure that they're accurate, and then importing all the information into the centralized database that was in out systems. And then we quickly were able to build a customer experience where they could self-serve. Customers could go out there, do a search, finding a testing location themselves. I'd say timeline. We spent about a month building the back office and then deploying out the first version to our customers as well. Very, very rapid, very high quality. And what we've taken it further even since that first month, we're just now actually building it into and integrating it with a health bot that we have developed in parallel separately. But it just illustrates the agility that we've had the flexibility to be able to take a solution that started out as, hey, I want to find a doctor to quickly morph to help me find a test location for COVID-19. Yeah, it's amazing, Bruce. I think back in my career, very early in my career, how long it would take to build the schema, build out a database and populate all the data on how many interns you need to do that to the websites to now that modern app deployment. So 30 days, that's phenomenal from kind of full end and obviously you still have some resources keeping things up to date. Do you have a rough swag? If you hadn't already been using out systems, would this have been two, three months or is getting from the ground up, how long does that take? Yeah, great question. Overall, so short answer is probably what it took us about four months using traditional methods. So instead of four months, about a month. And that's pretty consistent, what is what we've seen with all of the apps that we've built so far without systems. We're seeing about four times the value, I like to say four X value and that being a quarter of the cost, the quarter of the time. And we typically will over deliver on scope. It's not too often you can say that, we've made it on budget, on time, but we over delivered scope. But generally speaking, we're seeing about four X value. Now I would say coincidentally when I was doing the startups I mentioned earlier, I would see up to 10 X value compared to traditional hand coding and large development teams in the startup environment. So smaller companies I think should expect to see even better than four X. Well, that's great. Bruce, since you have such a long history without systems, I'd love to get your take on some of the enhancements. You look at, it's not just a platform, but they're helping give guidance to build faster. There's really AI being built in. What have you seen over the years? What's exciting you these days? Anything else that you're kind of asking for that maybe we should be looking for down on the roadmap? Yeah, that's one of the greatest things I really enjoy about the OutSystems partnership is their level of investment in the platform. And they're like, I'm constantly trying to think forward in healthcare, what are our customers going to need tomorrow? OutSystems is doing the same saying, hey, what is Bruce going to need to drive his digital business forward in the future? So two big things really come to mind. Number one is mobile. When version 10 was launched, I started on version nine. When version 10 was launched, it was lights out when it came to mobile. It was an absolute game changer. For the first time, I didn't have to have a large iOS and Android team and a web team and a back office team. So typically I'd have four different teams when those specialties didn't need that anymore. We could do full stack now with just about any developer. So that was huge. The second huge innovation is, I would say the AI you mentioned is that now that the new developer productivity that you see embedded in the app, the suggestions, it's almost like the platform anticipates what developers need next in their daily tasks. So I know that's been a big help. Then I think the last thing that I'm looking forward to that I know they're working on feverishly is really bringing it more to even a wider audience of citizen developers. So designers, we've got a few use cases where our marketing team has worked with us and some of their marketers and designers that aren't developers at all saw us building things. And they said, hey, you know, after the first couple of apps they designed with us, they said, I think we can do this ourselves for some basic things. So they did, they started building some basic things. So I'm really looking forward to that push out towards more business folks even further than what they've already done before. Yeah, but Bruce, this is such a good point, something I've seen in the serverless community really enabling, as I said, back in the early days, it was programming. You wrote lines of code. Coding was you pulled pieces. The discussion of low code is trying to make it even simpler. And with more modern platforms, more modern tools, as you said, it can anticipate things. You don't need to, you can even have that citizens developer, as you said, go out there.  You've been part of the OutSystems events in the past. What do you enjoy talking to your peers about, sharing your story, what are the things that you wanna make sure that people, if they're coming to virtual and maybe it's their first time, understand about shows like Next Step? Yeah, Next Step is just a fantastic event. It's like I always said it, I'm a calendar, never miss it. Disappointed I won't be able to sit and have a meal with some of the folks in person, but we'll get to it next year. But no, I'd say the sessions, of course, my session I was excited to share more detail on how we went about creating this COVID-19 and this universal finder. So there's tons and tons and tons of sessions just like those get great insights and to make new contacts as well. So I would encourage folks to pick me up on Twitter, pick me up on LinkedIn and others and network because when it comes down to it, we're all innovators and we're all trying to solve the needs of the communities that we serve. And I believe we're better together. So thanks for having me. Well, Bruce, we'd love being able to share those stories. Thank you so much for what you were able to do, such a valuable important thing at the community as a whole. And thank you for sharing your story on theCUBE. You're great. Thanks again for having me. Thanks, Stu. Stay with us for a lot more coverage from OutSystems Next Step, I'm Stu Miniman and thank you for watching theCUBE.


Well, hello and welcome to another Dev Nation live. Thank you guys so much for showing up for us today We're only gonna spend about 30 minutes working through some things here with Rafael. So just you know I'm presently in New York City. That's actually why you see me in yet another hotel room seems like I'm all over the planet and Rafael he's down in Brazil. Yeah, is that right Rafael? Or you outside of Brazil? No, I'm outside of Brazil. I'm at Annapolis. It's a interior city of the state of Gueas here in down Brazil Okay, okay, and Rafael is originally from Brazil though. He now lives in Orlando, Florida But like me which I live in Wake Forest. We're all traveling all the time It seems like we have a really great session for all you guys today We're gonna deep dive into the world of Docker Linux containers Specifically how C groups will trash your JVM and the things you can do to get around it to make sure that your Java Virtual Machine behaves much more happily in a Docker world. So at this point Rafael take it away Okay, perfect. Let's start sharing my screen and I'm gonna second Okay Today as we're said we're gonna talk about why Docker fails in white Java fails inside Docker We all know how containers have tended the world the world But sometimes things can go wrong especially when it's related to Java in the The container format have helped us to place a lot of everything inside it our software our Operational system the file system everything and even our Java program Even our Java application can be inside a container, but the problem happens when we lock The JVM the Java application inside a container that doesn't make The software the Java application be happy and things can go totally wrong The idea is that Java the Java application like to live in an open Without any limits of memory or any constraints about memories or CPU and today we're gonna see What causes this fail and how to deal with that what we can do to make Java love containers To understand that let me give you a Brief history about containers containers is not something new most people think because we are talking a lot about containers in the last three or four years that containers are With it's a new thing in the IT industry and if we pay attention of the in this slide we can see that Containers really started in around the year 2000 with the j os added to free VSD and then we start we had more things coming like generic process in 2006 which lead it to control groups and From from control groups. We had the future inside the kernel and User spaces which lead led us to the Linux container project. Let's see and then finally Not by con lighting talk dot cloud introduced us the world of Docker containers and Then we are everything after that was a big improvement like Google Kubernetes which gave the origin of open shift and Now everything related to containers became became a standard via OCI and CMCF But there is a problem Java came before the year 2000 we We have the Java version one zero children released on May 3rd of 1996 and J to E which is now E for J Was released in the end of 1999 what happens is that? behind the scenes of a container We have a kernel feature The future of a container happens because of C groups and and namespace all of both of them are features of the kernel So the C groups creates And together with namespace creates an idea that you are running your piece of code inside restricted namespace and with a restricted limit and memory and device with all with its own devices and When it's related to memory Inside C group we have in the file system slash C's of the slash fs lesson group memory We have all those files here and these here in bold memory with limits in bytes Specifies them the limits of the container itself But there is a problem related to Java Let me give you an Idea on what happens to Java to other kind of software when it's not related to Java I have used it here Docker machine to create two kinds of much machine one This one called Docker one hundred a thousand twenty four. It's a virtual It uses virtual box just to run our demo With a memory of one gig a friend Okay, and I have another Docker machine that was created with eight gigs of friends So you can have an idea on how the the Java application behaves in two different configurations, okay Let me do the following Let me do a Docker machine ssh and This machine here Docker 124 Thousand and 24 if I run the command three Dash eight I can see that this machine has one week of memory of ran and one gig One get one point one gig of swap. Okay Running software on this machine so I'm pointing my Docker client to this specific machine and What I will do now is run a container a central container with the following With the following Switches, I mean I said I'm signing a terminal. I'm dropping the container after I run it And I'm limiting the memory. Let me show you something here doctor dash eight The doctor Run the shades help and said The dash M Specifies the memory limits, okay So I'm specifying here a limit of a hundred mags and a memory swap of a hundred mags as well I'm running the center OS image and I'm running the same command three dash eight When I run dash three that age on a container that has a memory of a hundred mags. I still see One gig of memory So that seems a problem right because I restricted my content I just gave one hundred mags of memory limits to this container and This is not a problem of the office the center West distribution I can take another distribution here like I'm running Ubuntu and if I run the same command I Can see one geek of memory so This is what happens with Java as well both They come both commands pre Java the jg or machine. They don't look inside that that file here They see file system group memory Okay, so you can think why does this uh Dash M What's the purpose of this dash M if my software can see the complete environment and to have an idea why? Where it can be used I will run here a container In the interactive mode with the name my wall fly, but they will restrict the memory with a low of 15 mags, okay, so I'm running a boss wall fly here Look here. What happens if the container will try to start with? Maximum heap size of 512 mags We can wait a couple of seconds and see what will happen to this container Of course at this moment. It's trying to do a dr. PS here Dr. That's Dr. That's we can see that around It's trying to limit and then the container died the boss process. We see the kill sign Okay, this is very important because what happens when we specify the memory limit We are saying we are saying to the kernel if something tries to use more than 50 50 mags Kill the process. So that's why the judge it give us as process receive the cues sign. We can even explore that By using the command dr. In fact The container name and I'm getting the form the format in case on so I want to see the state oops, let me close here here plus If we get the doctor's fact inspect and take a look at the state Of this container. We can see that it exited. It's not running running false. It's not paused It's not restarting, but it was OOM killed True, it means that it was killed because of out of memory So when we specify The memory limit like we did here We are saying to the kernel everything that tries to use more than 50 mags, please kill it The problem is that the Java itself Sees more than It doesn't look at this information here. It doesn't know that's running in a restrict memory And that's a problem not only with our soccer. Let me show you something else here with Java the problem have we will see why it fails when we are running from from the developer workstation to a six To a production server with 64 gigs that we'll see that later But why does Java fail? Java the JVM sees all the host resources. It doesn't it is not aware of C groups So if you'll get a if you implement a software that does a system out print land print a land memory Using the runtime get runtime max memory or and getting the all available process Processors it will see they all the CPUs and all the memory of the host And if you think that it's a problem just to your software look here This this same code is used by different servers Don't cat uses that in different parts of it of its servers of its of it It if you can see parts of that in Catalina It can be it's also used in at the ni all I think channel the status transformer even won't fly and when it's getting the processor info info it gets the Information vertex inside vertex options. So everything that's Supposed to run in a container it will will not be aware of its limits So now that we know that the container die the container gets killed. Let's do a trick thing An application that I built for this specific demo This application here is a spring boot application That when I access this endpoint called memory It will get the runtime Get them the the max memory and it will try to locate 80 percent of the memory With strings. We all know that strings are unmotable and then we append String over string until we reach 80 percent of the total memory So this application here. I have built an image and I will now run This container Switches I will erase the container. I will give the name my container 150 because I'm limiting the memory with 150 mags Holds in the port 8080 Okay, so let's and also let me show you something here in the software and the software here You can see that I in my Docker file Let me get the open in my Docker file that uses open JDK I Enable the print flags final and print garbage garbage collector details. That's why you are seeing This information the log Location failure. Okay. My application has started now. I will access this application endpoint. I will do a call at HP dot get doctor machine I IP Doctor port 8080 API memory Okay, let's access That endpoint so you can see that's tried to locate eight percent of the memory. So I located more than eight percent Of the max allowed memory size of two hundred and forty one mags So we have now a location of 2015 mags and Application still running. Okay, I can run that bet more than once. We can see that we have the same location size But here we can start to make questions. The first question is Remember that I run my I ran my container if I do a doctor at doctors stats My memory limit is a hundred and fifty mags, right? I Have allocated a hundred percent of RAM but the Application set that I allocated two hundred mags. So we have a first question is how is that possible? how I could allocate two hundred and fifty mags and If I have a limit of a hundred and fifty The answer to that is because when I run a container, I So I just killed this container I Need to specify also the if I don't specify the memory swap swap it will create a 105 mags Run and a hundred and fifty mags of swap. Okay, you cannot have a container with less or memory swap then The one that to then the memory that specified for example, I'm specifying here container of a hundred and fifty And the memory swap of ten mags. You can see that the container will Say you cannot have a minimum memory so Swap limit that the memory the minimum memory swap limit should be larger than the memory limit so when I'm running a container like I did here with a hundred and fifty Mags, I have one hundred and fifty mags of the container of the program and plus are 150 mags of Swap so that's what that's why I could locate 215 mags Okay, and the second question is why it said I'm gonna run the code command here again. So it's trying to locate The the first answer to 215 is because we have a hundred and fifty of ran and one hundred and fifty of swap Okay, and the second question is why the JVM said that I could the maximum allowed memory is 241 It said that's 241 because if we go to the to the documentation of the garbage collector ergonomics We will see that the maximum heap size Here is Smaller of one fourth One fourth of the physical memory of or one week so in our case since the this They hold here Get it if my condom and my Docker machine has one week of memory one fourth of The memory should be two hundred and fifty mags So that's why the the heap size. I'm the maximum heap sizes is close to two hundred and forty one bags. Okay so now that we know That the JVM Looks it doesn't look to see groups. It doesn't look to the memory limit. It uses to It uses the memory of the host Let's see what happens if we do just like here in the slides Suppose that you are running in our 8 gig score and Go to a 64 gigs eight gigs of Fran and go to a 64 gigs of Fran in my case I'm running the I was running the application here in Docker machine In a Docker machine with one gig of Fran now I will point my Docker client To my machine with a hundred with eight thousand and a hundred and ninety two Mags of friend. Let me show you that Docker machine SSH Docker eight thousand a hundred and ninety two Three dash eight it almost eight gigs of friend plus three almost three gigs of swap Okay, and I will run the same application here Docker run My companion with a hundred and fifty mags With a limit of a hundred and fifty mags That's with our application to load And now that the application is loaded. Let me change here and point application To the Docker with eight gigs of friend Let's take a look what's happening Location failure allocation failure. It's trying to locate memory Trying to location and the application was killed So this is very important. Remember that I when I ran the application Inside Docker with a hundred and twenty four. I could run the application several times. Let me start with that to start Even with these allocation failures from the garbage collector We can see that the application was able to load and I can involve invoke My endpoint that consumes eight percent of memory several times and see here. I'm running that the Endpoint several times and the application didn't die but if I use more memory and run the same application with the same parameter and parameters with a hundred and fifty mags the application crashes and that crashes because With eight gigs of RAM To the one fourth of eight gigs of RAM is Almost two gigs, right? Let's see it here. The application is this is started. Let's try to access the application died Okay, because it tried to Let me see the memory here It Max heapsize Then it tried to locate the maximum heapsize of more than than two gigs Okay, because this is a eight eight gigs machine and When I try to allocate the this the software it of course With eight a gig of RAM it was not possible, but now let's increase the amount Here in the container as well. Let's give more memory to this container. Let's give 800 Even with eight hundred of memory limit it will fail So it's not only when you will increase the memory amount on the whole But even if you increase the memory of the container The application it will also fail because 800 is not enough and why it's not enough because with 800 of memory limit It means that the container has one gig point six eight hundred of RAM and eight hundred of swap You can see that it takes more time to to die, but even so the container Will die As you saw here because it needs more than two gigs Okay, so increasing the memory is not the solution So what should be the solution the solution for that is that is to Specify yourself the Java options. So I have here another Docker file That I create an environment variable called Java options where I can set The maximum heapsize Memory myself, so I run that the the same container In the same holes with eight weeks with with a container limit with About 800 megs of limit and with a maximum heapsize of 300 megs Dr. I am my container eight weeks Hey, that's Dr. Logs My container eight weeks, let's wait the application to become available. So I have a container limit of 800 but the heapsize was specified to 300 so now I can run my application my application several times But the maximum heapsize is close to 300 and my application is not dying anymore So this is a good solution for that But the question is can we get better? Of course, yes, because The fabricate project already provides a support for For the for the JVM ergonomics Let me show you here if we use the fabricate the image provided by fabricate Which is this other Docker file here. You can see that it comes from fabricate I don't need to specify any JVM option. They fabricate itself the image reads the container limits it reads the number of CPUs from the C groups it reads the memory from From C groups as well and and then it this information is used to calculate the memory so if we use that image from fabricate I Can run for example the container with no limit if you do It will exact Java dash CP with the class path Local and if you run your jar if I specify a memory limit of a hundred and fifty mags It will automatically set the memory size of a hundred or seven seventy five mags If I specify the memory limit of three hundred It will also adjust itself to a hundred and fifty always the half of size of The memory limit if I specify two gigs The maximum hit size will be one week. So it's it's it automatically creates The proper x and x parameter with Respecting the limit of the container We can take a look here at the documentary at the documentation of this image that If you don't specify the max memory ratel The default is 50 which means that 50% of the available memory is used as a upper bound boundary Okay, let's just remember that the memory limit itself The hip itself it's not the total memory used by by the KVM we have we need memory to For this thread stack we we need the memory of the perm Prem size memory. So it's not only the heap. So that's why People recommend 50% of the memory limit Now that we talked about that we We can see that until the version one 121 of the JVM with the memory limit of a hundred The maximum hip size was close to two gigs because I'm running here on the that Docker machine with eight gigs of rent, right? but now starting from The updates 131 There is a experimental VM options that you need to unlock using this flag plus unlock experimental VM options and Plus use the C groups memory limits for hip If we we run both it will be If we read the memory limit and set the maximum hip size As a as a half of them of this container C group so in this case if I run I I My my container with 300 mags of memory limits It will give me a hundred and twenty one mags of maximum heat because now I enabled The JVM to use C groups C groups for our memory limit, okay? That gave give us an idea on why docker fail on Java. I Like to share with you the link for this For this slide back, I guess that work and share that with you in the chat box I can And we do have some questions and actually more statements people are like well Maybe it's just an operating system problem or not a JVM problem or maybe it's just you know Why are you using your docker with a limit to begin with you? Can you address either those points? Okay, sure, as you could we could see in the beginning. This is not related to OS problem, but let me get here my machine with 124 in the beginning. I ran Docker You get here Run I am I've tried a Memory limit of a hundred mags and I run sent OS with three Three exist before C groups. So that's why three also sees one week of memory. I Tried another line of distribution Like a bundle and three it still gives me one bit of memory the problem is not the OS itself, but Tools like JVM free and other Other Applications does not understand C groups the containers is total are totally different from virtual machines So it's the container limits are based on C groups and namespaces and What's the other question for? So, you know, there's a conversation around metaspace and Java 8 that could be very interesting the one point to think about that too though is the In in there's a 64-bit JVM issue and a 32-bit JVM issue one of the things we're considering is recommending 32 bit JVMs For those situations where you are going to constrain your container down to let's say under one core and under a gig of RAM Mice will use a 32-bit JVM for those scenarios and it will you actually will save a ton of metaspace as an example In 64 bit JVM you get double the metaspace Yeah, that's true. Yeah, and then so what there was a question about the number of cores and in the Presentation you will see the link to the presentation You'll see references to cores in a longer form of this presentation We talk about cores also, but at least the cores does not blow you up. So that's the thing to keep in mind Yeah Most most of the of the blow-offs are happens related to memory That's why we also decided to cover only memory here at the definition live mostly because we have a small Just a few minutes to to give you an idea and Also because CPUs are not a big deal Okay, and we're at a time I did provide the link to the slide deck where you guys can go follow up on that presentation and see all the links and embedded Information in there. There's a ton of good information in there. Also taking you to the various You also should read the notes associated slide because in some cases we put in there Here's the information for the JVM ergonomics or here's the information for our Kubernetes Calculations and what Docker API it's using and you want to make sure that you're configuring things appropriately in a Kubernetes setting Versus Docker setting are slightly different And just want to make sure you check those things they the big issue Of course the reason we're talking about this is when you actually build it in deployment Are sorry build it in development and then deploy it to a really large Let's say EC2 instance or a really large production level machine the Java virtual machine by default Even though it's inside a Docker container. We'll see all the memory of the Production server and all the CPUs of the production server It'll over report them to your application and of course your application might just blow up and in that case It silently fails. So that's what we're talking about it And it's super easy workarounds based on what Raphael provided today Raphael awesome job on the demonstration. Thank you so much for that Thanks so much for and thanks so much for everyone who's joined us and for everyone that we will watch the definition live Yeah, yeah, thank you guys so much for showing up today and keep watching developers on red calm damnation live for future updates We have more sessions to come and the session that was originally scheduled for today with James Rawlings We'll make sure to get him on deck again when he becomes available He has a really great talk on how to run continuous development or sorry Continuous delivery at scale because we're doing on a very interesting project. Well, thank you guys so much Thank you all


Titans won a thriller over the Chargers. We've never seen an ending like that at Nissan Stadium. So what I'm wondering is where were you when it was all going down at the end and how quickly did you know what had actually happened? Yeah, wild ending, certainly putting it mildly. A lot went on there at the end of the football game. I was in the booth. I didn't have a great view of the play live. I was watching the video boards when it went to replay and was waiting anxiously. I think for me when I realized we had won the game is when I saw Phillip Rivers kind of popped his helmet off and was congratulating our defense. It was very settling to think that we had pulled it off. A little later in the program we're going to hear from Jeffrey Simmons and he had a pretty special debut after sitting and watching the tape. What made it so special? Well, I think for him it was and watching him we saw the player that we had scouted at Mississippi State. The confidence that he had to go out there when called upon whether it was a run player or pass play. He went out there and he executed the call and he didn't hold anything back. Yeah, Jeffrey did an outstanding job. You got a lot of production from your rookie class, your draft picks. Are they starting to find their way with this football team? Yeah, I think we touched on Jeffrey but we're about midway through the season. AJ has made some big plays for us, continues to work on the details. I thought one of the more impressive plays he had was a block that he actually made in the Derek Henry run. He didn't hold the guy, he shielded the guy, held him off long enough. It's the details of plays like that that can really make those guys improve. Nate Davis got off to a really good start before an injury. Amani Hooker has really helped us in sub-defense and probably one of the unseen things was Sunday in the game on the fake punt he was the wing and he did a great job with his release. He shielded the guy close enough to Kevin to give Kevin just enough time to get the first down and then David Long really showed up and played some plays for us Sunday defensively. He's been a kind of a mainstay in the kicking game and had a big play on the screen Sunday. Also getting a lot of action for Wesley Woodyard who played in place of Jay on Brown. He had seven tackles and caused the fumble that won the Titans the game. How is he able to continue playing at such a high level? Well, I mean he's seen a lot in his 11 years playing the game. I think it's his daily approach to being a pro. Whatever's asked of him whether he goes in there as a starter, whether he comes in as a sub, whether he plays on the kickoff on the punt, whatever's asked of him, his attitude and his demeanor and trying to help the team win on a databases is paramount. John Derrick Henry just keeps on rolling. What is it about his preparation or his attention to detail or anything else that has allowed him to be so consistent in this his fourth NFL season? I think it starts with his attitude at practice every day. He's the guy that brings juice to practice.  I think he's done a really good job of lowering his pad level when he goes through the line of scrimmage. A, it gives him more power and B, it gives the defense less surface area to hit and he's really made some explosive plays for us in the passing game, you know, which kind of keeps defense is guessing on how we're going to utilize him. Tampa Bay is coming in the Nissan Stadium this week. They're coming off of a buy, so what can you tell us about that team?  They're explosive on offense. They really are. They've got playmakers, you know, at the skill positions where there's Mike Evans, Godwin, O.J. Howard, Cambray, you know, they're really good at throwing the football downfield and trying to stretch you and attack you that way. And defensively, they're number one against the run.  They've got a really good front seven with Via, with Sue, Shaq Barrett, who came over in free agency, has made an impact, you know, in his time there. And then their linebackers, Levante David has played a ton of football. He's been to Pro Bowls and, you know, the top five pick Devon White. He continues to run and make plays.